BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

waveInOpen and CALLBACK

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Multimedia
View previous topic :: View next topic  
Author Message
jh
Guest





PostPosted: Wed Mar 22, 2006 10:03 pm    Post subject: waveInOpen and CALLBACK Reply with quote



I have no problem with playing wave files with CALLBACK_WINDOW. I have
questions about other CALLBACKs. I want to play files using file stream not
from memory (large audio files).

1. Using CALLBACK_FUNCTION looks a little bit strange because I have no idea
how to finish playing... I prepare next headers when buffers are returned to
application (waveOutProc) - ok. But when audio stream reached the end I'd
like to reset and stop the wave out device. The problem is I cannnot do it
from waveOutProc (Applications should not call any system-defined functions
from inside a callback function, except for EnterCriticalSection,
LeaveCriticalSection, midiOutLongMsg, midiOutShortMsg, OutputDebugString,
PostMessage, PostThreadMessage, SetEvent, timeGetSystemTime, timeGetTime,
timeKillEvent, and timeSetEvent. Calling other wave functions will cause
deadlock.). So how can I stop it? Posting a message? Then it looks like
CALLBACK_WINDOW....

2. CALLBACK_THREAD. Does it mean that Execute method of the thread should
prepare a next buffer for playing? But how can I know what buffer is
returned? CALLBACK_WINDOW and CALLBACK_FUNCTION return address of PWAVEHDR
structure. How it looks with CALLBACK_THREAD?

3. CALLBACK_EVENT. Similar problem. I cannot find any example how I should
use it.

What are benefits of using these callbacks? Which one I should use and when?

Please don't suggest using components. I want to use WinAPI solution.

Jacek
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.