Beep!

Blitz3D Forums/Blitz3D Beginners Area/Beep!

Moraldi(Posted 2008) [#1]
Is it possible without load a sound file?
I need it for debug purposes.

Thanks!


jfk EO-11110(Posted 2008) [#2]
There is some sourcecode in the archives.


Moraldi(Posted 2008) [#3]
Thanks, to be honest I didn't search...


Ross C(Posted 2008) [#4]
I believe there is also the ability to use the beeper the motherboard uses when you have an error at startup. I think it's an ascii code?


Zethrax(Posted 2008) [#5]
Use api_Beep( 1000, 150 ). The first parameter is the frequency, and the second is the duration in milliseconds, so experiment to get the sound you want. You will need to have the userlib file found at http://www.blitzbasic.com/codearcs/codearcs.php?code=1180 in your Blitz3D userlibs folder.

You can also use api_MessageBeep (wType%) to generate system sounds. You will need the userlib file found at http://www.blitzbasic.com/codearcs/codearcs.php?code=1179 .

eg.
Const MB_STANDARD = $ffffffff
Const MB_ICONASTERISK = 64
Const MB_ICONEXCLAMATION = 48
Const MB_ICONHAND = 16
Const MB_ICONQUESTION = 32 ; Silent???
Const MB_OK = 0

api_MessageBeep( MB_OK )

WaitKey
End



Moraldi(Posted 2008) [#6]
Thanks Bill Stanbrook. This is an elegant solution!


jfk EO-11110(Posted 2008) [#7]
Uh, I feel like I need to program the beeper now, anyone remember the 1-Bit speech demos?