PC sounds

Just starting out? Need help? Post your questions and find answers here.
Banaticus
User
User
Posts: 21
Joined: Fri Oct 24, 2003 5:49 am
Location: Redlands, CA
Contact:

PC sounds

Post 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?
--BX
Rogue
User
User
Posts: 10
Joined: Wed Jul 09, 2003 12:27 pm
Location: Michigan

Post by Rogue »

You could use the Windows API using the Beep_ command:

Code: Select all

Frequency=500
Duration=500

Beep_(Frequency,Duration)
Where ever you go, there you are.
Banaticus
User
User
Posts: 21
Joined: Fri Oct 24, 2003 5:49 am
Location: Redlands, CA
Contact:

Post by Banaticus »

What is the Windows API?
--BX
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post 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
plouf
Enthusiast
Enthusiast
Posts: 281
Joined: Fri Apr 25, 2003 6:35 pm
Location: Athens,Greece

Post 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)
Christos
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

Or look in the jaPBe-Includepack "SoundPlus.pbi"

CreateSound (Nr,Frequency,Duration,SampleRate)
Post Reply