I create application with Sound sub-system and planning to PlaySound's in some cases.
I want have possibility to Mute my application via Windows 7 Sound Mixer.
The problem that application added in Windows 7 Sound Mixer only after PlaySound() function execute. Example:
Code: Select all
#ogg_file = "D:\sound.ogg"
If InitSound() And UseOGGSoundDecoder() And LoadSound(0, #ogg_file) And OpenWindow(0, 0, 0, 200, 100, "")
ButtonGadget(0, 10, 10, 60, 60, "Play")
Repeat
Select WaitWindowEvent()
Case #PB_Event_Gadget
Select EventGadget()
Case 0
PlaySound(0)
EndSelect
Case #PB_Event_CloseWindow
Break
EndSelect
ForEver
EndIf
I can use this "hack":
Code: Select all
#ogg_file = "D:\sound.ogg"
If InitSound() And UseOGGSoundDecoder() And LoadSound(0, #ogg_file) And OpenWindow(0, 0, 0, 200, 100, "")
PlaySound(0, 0, 0)
ButtonGadget(0, 10, 10, 60, 60, "Play")
Repeat
Select WaitWindowEvent()
Case #PB_Event_Gadget
Select EventGadget()
Case 0
PlaySound(0, 0, 100)
EndSelect
Case #PB_Event_CloseWindow
Break
EndSelect
ForEver
EndIf
And another question:
PlaySound have flags, I use 0 value for ignore it, this is correct? #PB_Ignore not corred (exactly as #PB_Sound_Loop).