I get no sound at all from that code mtnhome3d. I do notice the system halts when the beep is happening, but otherwise nothing.
EDIT: Oh, I noticed there is a jumper on the motherboard set to off concerning the pc speaker :o hummm...
EDIT2: Perfect, I switched the jumper on the motherboard for it's internal speaker to "ON" position. Now the beep instruction works :)
Allright! Here's a small test with a practical little equation:
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
Got help from this site for converting notes to frequency for the PC speaker:
http://www.sengpielaudio.com/calculator-notenames.htmThe only problem I find with using api_beep is that it hangs the application when called. Also I don't see a way that it is possible to detect if the speaker is hooked, which can be another interesting problem.
I've added this to the code archive :)