Advertisement

Porting PC speaker sound effects to Win32

Started by February 14, 2003 02:20 AM
6 comments, last by DivxGuy 21 years, 9 months ago
I have the source code for an ancient DOS game that used the PC speaker to create semi-realistic sound effects; basically, they sped up the interrupt timer, captured interrupt 8, and were constantly changing the speaker frequency, depending on what effect was in play. I would like to port this game to Win32, and was wonder if anyone here could suggest how to achieve roughly the same effects using the sound card? Thanks, RD
I''ve not used the speaker but heard that you simply wrote 0 or 1 to it for in and out and therefore achieved 1 bit sampling ?

If so you could do the same with a waveform by simply sending zero or full (255 for 8 bit, 32767 for 16-bit) to the soundcard.

Of course an easier way would be to sample the original sounds with a mic and use the resulting waves as your effect.

Mark
mark@cornutopia.net
http://www.cornutopia.net
http://www.bytten.com
Advertisement
Under Windows API there is a Beep command which takes two DWORDs, the first is the frequency, the second is the duration in ms. AFAIK this does not work properly under W95 (it will play a default beep instead of the one specified)
I looked that function up, but it doesn''t work properly under any of the Win9X operating systems. Thanks for the suggestion, but it is obviously not something a Win32 game would use.

Back to the drawing board.

RD
most soundcards have the option to connect to the system beeper, and play the system sound through the sound card. that means, you could run a recording program in the background while you''re playing all the speaker sound effects, and record them as wav files. in the port of the game, you play the recorded wav files.
Thanks for that suggestion. I wonder if I could use a 4.77Mhz XT, install my old 8-bit Soundblaster in it, and use a line out into another machine that would record the sounds.

RD
Advertisement
do you still have such a thing?
heh, I have one, tandon XT, 2 x 5.25" floppy & no hdd. it''s >2 years ago I had it operating, I''m curious if it still works, it''s 20 years old. Next time when I''m at my parents'' house, I''ll try if it works

well...you could do this, but you''ll get more noise this way, I suppose.

Hey, if it''s just to record this sounds, you could leave both your XT and your recording computer open (I mean the cases), having the XT''s system beeper connected to the soundcard of your newer PC. so you have one noise source (the 2nd sound card) left out.

or, maybe, you don''t even have to leave the cases open, if you want it "the clean way" if you have several old games that you want to port...it could be worth the effort to get some thin shielded cable, and...how is it called in english... this little peace of metal, where all the jacks are fastened to, on your sound card, graphics card etc.?
get such a metal thing without a card sticking to it , bore a hole into it, screw a jack of the same type as your soundcard''s jacks into that hole, and put it into an unused slot of your XT.
then you connect the system beeper (maybe with shielded cable instead of the cable that''s normally between the speaker and the mainboard, and leave the speaker disconnected, of course. for the system-->speaker connection it doesn''t matter, but you''re going to amplify the sound, so I''d say, get shielded cable)
to that jack. now you have an XT with an "out" jack, just like a sound card ;-)

Well..try it, but I''m not sure if it is a good idea to connect this to the soundcard''s "in" jack, because of the different impedancies. I suggested the soundcard type jack for you can use a standard shielded cable (with plugs) outside.

You could get another one of this metal peace, insert a jack into it, and connect the jack (with shielded cable) to the special beeper connector on your sound card (at least all sound blaster cards have a special connector for this purpose. don''t know about other cards)

now you can connect the two PCs with a (shielded) cable, and have the XT''s beeper connected to the other PC''s beeper connector, just as it''s supposed to be.

speaker sounds are really amazing sometimes. I have heard real sounding talking over the pc-beeper. I always wondered how they did this, AFAIK you cannot change the amplitude of the system beeper.
with fast tracker 2 you can output the music over system speaker, sounds not bad!
BTW looks like I'm not the only one interested in this old game; it turns out that there is even a site devoted to it!

RD


[edited by - DivxGuy on February 24, 2003 3:21:15 AM]

This topic is closed to new replies.

Advertisement