What's going on with sound ????

Just starting out? Need help? Post your questions and find answers here.
Skipsy
User
User
Posts: 98
Joined: Wed Apr 30, 2003 12:26 pm
Location: France

What's going on with sound ????

Post by Skipsy »

Hi folks,

Iam test sounds...
Could someone explain what going on with the
following ? :

If InitKeyboard() = 0
MessageRequester("Problème","DirectX 7 (InitKeyBoard)",0)
End
EndIf

If OpenWindow(1, 200, 200, 660, 510, #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget, "Blob") = 0
MessageRequester("Erreur", "'Window'", 0)
End
EndIf

If InitSound() = 0
MessageRequester("Erreur", "Impossible d'ouvrir DirectX (Son)", 0)
End
EndIf

quit = 0

Repeat

; ---- Window events
EVT_WIND.l = WindowEvent()
Delay (1)

Select EVT_WIND
Case #PB_Event_CloseWindow ; Bouton 'fermer'
Quit = 1
EndSelect

ExamineKeyboard()
If KeyboardPushed (#PB_Key_Space )
Quit = 1
EndIf

Until quit = 1;KeyboardPushed (#PB_Key_Escape )

I can't quit the app (escape or SP).
But it works again if I remove :
If InitSound() = 0
MessageRequester("Erreur", "Impossible d'ouvrir DirectX (Son)", 0)
End
EndIf

Any idea ??
Thks a lot,
ww
Beware of the man who has the solution before he understands the problem...
Henrik
Enthusiast
Enthusiast
Posts: 404
Joined: Sat Apr 26, 2003 5:08 pm
Location: Denmark

Post by Henrik »

Hi Skipsy.
Yes InitKeyboard() and InitSound() don't like each other :?
I have made a bug report about it btw.
viewtopic.php?t=6149

When you use them together only InitSound() works..

I am now using InitSound() and win api "GetAsyncKeyState_(27)" ->27 = (#PB_Key_Escape )
the good thing about that is that it reports mousebutton's too GetAsyncKeyState_(1) ,2 and 4

Well cu
Bedst Regards
Henrik.
Skipsy
User
User
Posts: 98
Joined: Wed Apr 30, 2003 12:26 pm
Location: France

Post by Skipsy »

Great !!!

Thank you for the solution.
It is strange. I have re-typed the code in a new file and the keyboard
works now... I didn't checked if sound is working...

Anyway as it seems not stable I gonna use your solution.

Best regards,
WW
Beware of the man who has the solution before he understands the problem...
Henrik
Enthusiast
Enthusiast
Posts: 404
Joined: Sat Apr 26, 2003 5:08 pm
Location: Denmark

Post by Henrik »

Hi Skibsy
Addkeyboardshortcut() is an option too, just not for my purpose
It is strange. I have re-typed the code in a new file and the keyboard
works now... I didn't checked if sound is working...
Thats odd. :?:

Anyway, have a nice day :)



Bedst Regards
Henrik.
Post Reply