🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Generating sound effects with the internal speaker...

Started by
1 comment, last by Voice Of Tango 21 years, 1 month ago
For my current game I am planning to use the internal speaker for all of the sounds. I''m using a beep() function which takes parameters for the frequency and the duration of the sound. Obviously, if you use this for any extended duration you just get a solid beep. My question is: would I be able to use this function to replicate crude explosion sounds (you know the sort I mean) by using beeps of very short duration and rapidly changing the frequency in some fashion? If so, what sort of pattern would I use? I''ve googled extensively and found very little of value. Any help would be greatly appreciated, seeing as I know absolutely nothing about sound programming. Thanks in advance.
Advertisement
Some of the MOD players used to be able to access the internal speaker - have a look for some code or a library which will let you play MODs through the speaker...

Edit, I found this: "In the middle to late 1980's, software developers discovered that you could play digitized sound through the PC speaker without additional hardware by utilizing Pulse-Width-Modulation, which toggles the PC's internal speaker faster than it can physically move to simulate positions between fully on and fully off."

[edited by - Kenbar on July 3, 2003 6:00:34 PM]
VoT: you could d/l doom/wolfenstain source code from ftp.idsoftware.com and have a look at how they did it.
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared

This topic is closed to new replies.

Advertisement