Re: waveOutOpen with CALLBACK_EVENT example?



On Tue, 1 Nov 2005 22:56:16 +0100, jh wrote:

> OK. I've tried with CALLBACK_WINDOW. It works. Almost. The problem is audio
> pauses when minimizing, maximazing windows etc. I plan to play about 8
> stereo streams at the same time to 8 stereo output pairs of my RME HDSP
> Multiface II with synchronization between all these channels.
>
> Please correct if I'm wrong. I plan to use independent threads for playing
> data for each channel. Each thread prepares headers, loads initial data to
> buffers (wave file) and waits. Main application starts playing in all these
> threads at the same time. So it looks that I should use CALLBACK_THREAD...
> But I was suggested to use CALLBACK_EVENT as the best way to play wave data.
> What is the schema for using CALLBACK_EVENT?

Actually I've found that a single thread works best when you are trying to
maintain synchronization. There are a few ways you can handle this
depending on how the driver works.

Option A) If the sound card supports a multi-channel mode use it. The
device will need to be opened with a WAVEFORMATEXTENSIBLE wave header in
place of WAVEFORMATEX. If you need to take data from multiple sources
that's ok, interleaving the data is cheap.

Option B) Listen for event on first "device" only. When you get the event
you check the flags of all the buffers from all devices and see which ones
need servicing. This usually works fine if there is only 1 physical
device.

Option C) Wait for events from all devices but don't process until they are
all signalled (use WaitForMultipleObjects). Again, only will work reliably
with 1 physical device.
.



Relevant Pages

  • Re: Jake losing it fast now...
    ... Each time the Boks stumble, the management ducks in behind a World Cup ... any sort of plan with any player. ... contract to play in France. ... players who cocked up in Australia continue to be rewarded, ...
    (rec.sport.rugby.union)
  • Re: Hands up who think Sven-Goran Eriksson is a twat?
    ... >>> despite a poor manager who seemed out of his depth. ... >>> The concept of TEAM seems to play little part in his thinking or picks. ... >> It is also a problem that friendlies are not used to create a Plan B or ... the media frenzy that would follow. ...
    (uk.sport.football.clubs.liverpool)
  • Re: Hands up who think Sven-Goran Eriksson is a twat?
    ... >> despite a poor manager who seemed out of his depth. ... >> The concept of TEAM seems to play little part in his thinking or picks. ... > It is also a problem that friendlies are not used to create a Plan B or ... The side has to have some flexibility and be able to adapt from ...
    (uk.sport.football.clubs.liverpool)
  • Re: Hands up who think Sven-Goran Eriksson is a twat?
    ... > The concept of TEAM seems to play little part in his thinking or picks. ... It is also a problem that friendlies are not used to create a Plan B or try ... That us why you get to pick a 23-man squad not just a first-11. ... > Will Crouch play in the WC? ...
    (uk.sport.football.clubs.liverpool)
  • Re: Stargate/Defender- any helpful gameplay tips?
    ... The best bet is to play Defender, not Stargate. ... Default settings don't allow warping past wave 10. ...
    (rec.games.video.arcade.collecting)