delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/01/22:34:56

From: amihardj AT engr DOT csulb DOT edu (Ario Mihardja)
Newsgroups: comp.os.msdos.djgpp
Subject: How to play WAV via PC Speaker ?
Date: 27 May 1997 22:20:51 GMT
Organization: Cal State Long Beach
Lines: 44
Message-ID: <5mfmo3$l05@hatathli.csulb.edu>
NNTP-Posting-Host: heart.engr.csulb.edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019