Page 1 of 1

PC sounds

Posted: Sun Oct 26, 2003 11:41 pm
by Banaticus
Anyone have any idea on how to create actual computer sound? Not sound from a sound card, but the beeps of your actual computer box itself. You know, just like those old games that we all used to play a decade ago.

Code: Select all

IBM PCs
5 PLAY "o2colb."

TI-99/4A
5 SOUND (500,131,10,123,10)

Radio Shack
5 SOUND 89,5: SOUND 78,5

Atari
5  SOUND 0,121,10,4: SOUND 0,128,10,4
10 SOUND 0,0,0,0
(The numbers in front represent the code line number that had to be typed in front of each line of a program -- I sort of miss GOTO, and "real" IF THEN statements -- even if it did lead to spaghetti code. :lol:)
Perhaps this request for help on computer sound should be over in the Feature Requests and Wishlists forum instead of the Beginner's forum?

Posted: Mon Oct 27, 2003 4:10 am
by Rogue
You could use the Windows API using the Beep_ command:

Code: Select all

Frequency=500
Duration=500

Beep_(Frequency,Duration)

Posted: Mon Oct 27, 2003 6:01 am
by Banaticus
What is the Windows API?

Posted: Mon Oct 27, 2003 6:13 am
by PB
> What is the Windows API?

This is a very large set of Operating System commands that most
programming languages can use, without having to use commands
from the language itself. For example, you can use API commands
to do things that PureBasic cannot yet do itself, such as setting file
attributes (read only, hidden, etc) and so on. More info can be found
by reading the Win32 section of the PureBasic FAQ here:

viewtopic.php?t=4876

Posted: Mon Oct 27, 2003 12:31 pm
by plouf
you can also use dnhardware purelib by doobrey it has a HwTone() command witch is just that :D (you can find it in resource site)

Posted: Mon Oct 27, 2003 8:10 pm
by GPI
Or look in the jaPBe-Includepack "SoundPlus.pbi"

CreateSound (Nr,Frequency,Duration,SampleRate)