From: "Metroid" Newsgroups: comp.os.msdos.djgpp Subject: Re: How to play WAV via PC Speaker ? Date: 28 May 1997 01:26:29 GMT Organization: SuperNova Software Lines: 64 Message-ID: <01bc6aa1$855a5560$8941d9cd@null> References: <5mfmo3$l05 AT hatathli DOT csulb DOT edu> NNTP-Posting-Host: pm05-137.chattanooga.cdc.net To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk I may be mistaken...but I believe the PC speaker is only 1-bit...sound or no sound of course you can alter the pitch....hmm...anyway...I HAVE heard digitized sounds through the PC speaker in the past and to be honest, they sound like crap... also, it slowed the computer down a lot... -- ********************************************************** ---SuperNova Software--- * Making Games FUN Again! * metroid AT cdc DOT net ------(C.B. Meeks) http://www.cdc.net/~metroid/ ********************************************************** Ario Mihardja wrote in article <5mfmo3$l05 AT hatathli DOT csulb DOT edu>... > > I want to understand how one can play a Microsoft WAV > file via a PC speaker. > > Assume, I set the WAV to be : 11 KHz, 8 bit, and Mono. > > I have read an article written by Mark Feldman regarding > that subject. Alas, I still don't get it. > > The only sections I do understand is how to read 44 bytes > of header files ( "RIFF", file size, "WAVE", etc ). > > But when it comes to data chunks, the info seems to confuse > me. > > Now my questions are : > 1. When the frequency '11 KHz' comes in play ? > If I am not mistaken it is called '11025 samples / byte'. > But what is the connection to the PC speaker ? > Is this a delay between musical notes ( tempo ) ? > > 2. How do you generates the tones from the datas ? > I know the datas' range : 00h - FFh. > Is it signed or unsigned ? > Is it the timer divisor ? > > BTW, I know how to play with PC speaker with assembly x86. > > Because if I know all the connections, I want to make some > kind of procedure like ( in C ) : > > void Make_Sound ( int Frequency, int Tempo ) > { > Sound ( Frequency ); > Delay ( Tempo ); > No_Sound(); > } > > Hopefully, all the above are not lame. > Some pointers to the other straight forward sources are welcome > ( probably, some other FAQs ). > > Thanks in advance. > >