My sound stops playing when the form loses focus
-
Hi yall, I've written an app which plays wav files continually using DirectSound. Everything works fine until the app form loses focus, which causes the sound to stop playing. Thing is, i'd like the app to keep playing the sounds in the background while doing other stuff. How can I do this??? Thanx for any help, Dominic
-
Hi yall, I've written an app which plays wav files continually using DirectSound. Everything works fine until the app form loses focus, which causes the sound to stop playing. Thing is, i'd like the app to keep playing the sounds in the background while doing other stuff. How can I do this??? Thanx for any help, Dominic
Found this in the CP archives: DirectSound plays only when the window which is passed to SetCooperativeLevel, is foreground. If it passes to background, the playback stops until again the wnd becomes foreground. Unfortunately, this is the way how DirectSoundBuffer works. PlaySound API is process-wise (application-wise). Two (or more) processes can play sounds simultaneously but a single application can play one sound in a given time period. How intensively your app is going to play/stop sounds? (If it's not so intensive, maybe creating a child process per sound would do). ...
Blog link to be reinstated at a later date.
-
Hi yall, I've written an app which plays wav files continually using DirectSound. Everything works fine until the app form loses focus, which causes the sound to stop playing. Thing is, i'd like the app to keep playing the sounds in the background while doing other stuff. How can I do this??? Thanx for any help, Dominic