Code archives/Audio/Sounding the PC Speaker

This code has been declared by its author to be Public Domain code.

Download source code

Sounding the PC Speaker by _332008
Try this program for making some sounds with accurate notes to the PC speaker.

Got some help from this site for the Note2Frequency# function: http://www.sengpielaudio.com/calculator-notenames.htm

You will also need to have this DECLS installed in your Blitz directory (kernel32.decls): http://www.blitzbasic.com/codearcs/codearcs.php?code=1180
api_Beep(Note2Frequency(59),100)
api_Beep(Note2Frequency(67),100)
api_Beep(Note2Frequency(71),100)
api_Beep(Note2Frequency(66),100)
api_Beep(Note2Frequency(61),100)
api_Beep(Note2Frequency(68),100)
api_Beep(Note2Frequency(73),100)
api_Beep(Note2Frequency(68),100)
api_Beep(Note2Frequency(63),100)
api_Beep(Note2Frequency(70),100)
api_Beep(Note2Frequency(75),100)
api_Beep(Note2Frequency(63),500)
End

Function Note2Frequency#(note#)
   Return (440.0 * 2.0^((note - 69.0) / 12.0))
End Function

Comments

Heliotrope2010
What does api_Beep() do?


Code Archives Forum