Hi all, as requested by so many in the past, and 1 today, I have used the Kernel32 DLL to create random computer beeping. Use it to your advantage, and be sure to add a credit for me in your games and programs!
It can also be used to create music! =D
And without further adieu, here is the code:
Rem Project: Beep Function
Rem Created: Monday, September 12, 2011
Rem Created By: Mugen Wizardry | Credit: Mugen Wizardry
Rem This header MUST remain intact
Rem Credit is not neccessary but appreciated!
Rem ***** Main Source File *****
load dll "kernel32.dll", 1
global dwFreq
global dwDuration
dwDuration = 200
remstart
dwFreq [in]
The frequency of the sound, in hertz. This parameter must be in the range 37 through 32,767 (0x25 through 0x7FFF).
dwDuration [in]
The duration of the sound, in milliseconds.
remend
do
cls
dwFreq = rnd(0x7FFF)
call dll 1, "Beep", dwFreq, dwDuration
center text screen width()/2, screen height()/2, "Current Frequency: "+str$(dwFreq)+"|"+"("+"0x"+hex$(dwFreq)+")"
center text screen width()/2, screen height()/2+20, "Duration: "+str$(dwDuration)
sync
loop
Enjoy! =D
CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !