Playing a sound in DirectX9 from Non active window (VB.NET2005)

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I have what should be a simple problem but haven't been able to find a
solution.
I am using DirectX 9 to play a simple 16 bit mono sound file in a Sound card
modem application. The playback code is simple:
devSelectedPlaybackDevice.SetCooperativeLevel(Me.Handle,
CooperativeLevel.Priority)
bufPlayback = New SecondaryBuffer(Filename,
devSelectedPlaybackDevice)
bufPlayback.Volume = -5000 + 50 * intOutputLevel ' -5000=off,
0=full volume
bufPlayback.Play(0, BufferPlayFlags.Default)

All this works fine IF the application window is the active window. If the
application
Window is not the active window the sound card capture code (not shown)
continues to work fine but there is no playback from the sound card output.
This works the same way on several different sound cards (internal or
external USB). There is no exception thrown just no output from the sound
card. Once the window containing the application is made active again it
plays correctly.

How can I make it play regardless of the applications's window status
(active, non active, minimized)?

Thanks,
Rick Muething


--
Rick Muething
Winlink Development Team
.



Relevant Pages

  • IMS Telephone On-Hold Player 3.13
    ... The IMS plays telephone on hold messages or music using a computer ... background using the CPU idle time and the buffer on the sound card. ... play only on certain days of the week or times of day. ... feature or single line operation with a voice modem. ...
    (comp.software.shareware.announce)
  • Re: Shemti / Crocodile Temple + ousted
    ... Neither Shemti nor the Temple is in play at the requisite time. ... So in what window does Life Boon get played? ... Only usable at the end of a successful action (after resolving ... takes 1 damage. ...
    (rec.games.trading-cards.jyhad)
  • Re: both wandering now, Timothy and Will judged the weak streets among old powder
    ... I am admiringly good, so I play you. ... expecting, pulls almost seemingly, as the ache recollects at their ... cans mercilessly dine caps, the lentils often receive about the ... One more pretty smogs throughout the weird window were climbing ...
    (uk.rec.gardening)
  • Re: A Couple Of ALSA questions
    ... > for some niggly little problems I'm having with my sound Card? ... > wav etc.) I can't play midi files, nor audio cds directly from my CD ... You need a softsynth to play back midi files. ...
    (uk.comp.os.linux)
  • Re: Anything for home user and not the technical one??
    ... working and i am not able to play chess. ... 'user agent' and 'noscript' should not have any inner action to block other. ... games window opened, selected 'beginner', table window opened, clicked on ...
    (Fedora)