Actually if you call PlaySound with a non-existant sound file it will stop the currently playing sound. Bill >From: Sean Breheny >Reply-To: pic microcontroller discussion list >To: PICLIST@MITVMA.MIT.EDU >Subject: Re: [OT] wav-files via the PC sound card >Date: Thu, 3 Feb 2000 20:59:23 -0500 > >I think that a WAV file can really have several formats. If you take a look >at > >http://www.wotsit.org > >you will probably find some pretty good documents describing WAV files. >Many WAV files are totally uncompressed, and are just either offset or >plain 8-bit or 16-bit data. However, there are options for other formats >and ADPCM is one of them. > >There is a part of the win95/98 API (PlaySnd or PlayWAV, IIRC) which allows >you to play WAV files by just one line of C code (one function call). >However, it gives you no ability to stop the WAV file while it is playing, >etc. There are lower level calls which allow you to feed the samples to a >buffer and tell windows to send that to a sound card. You can tell that >win95's Sound Recorder does this because if you click on the window and >move it and then hold the mouse button down, it will play the sound for a >few seconds and then stop until you release, presumably giving it a chance >to reload the buffer. > >The first of these two calls deals with the different WAV formats itself >(although I don't know if it is compatible with them all). I think the >second function only works with raw samples, so you would need to extract >them from the WAV file. > >As I say, WAV file can actually mean many things. I once tried to write a >DOS program to read WAV files, and it worked fine with a large number of >WAVs but I would have problems with others (which Sound Recorder could >still read) so that clued me in to the fact that they vary a alot in their >exact format and that many simple, three page explanations of them will not >get you all the info you need to be compatible with all formats. > >Hope this helps, > >Sean > > >At 02:00 PM 2/4/00 +1200, Lance Allen wrote: > >All I really know is that WAV is a windows label of ADPCM which > >is a lossless compression standard. > >Elektor (www.elektor-electronics.co.uk) ran a stand alone wav file > >player (Feb 1999) that is an ATMEL AT90S2313 with a EEPROM > >and DAC hanging off it. So obviously it can be done on a PIC. > > > > > > > >_____________________________ > > > >Lance Allen > >Technical Officer > >Uni of Auckland > >Psych Dept > >New Zealand > > > >www.psych.auckland.ac.nz > > > >_____________________________ > > >| >| Sean Breheny >| Amateur Radio Callsign: KA3YXM >| Electrical Engineering Student >\--------------=---------------- >Save lives, please look at http://www.all.org >Personal page: http://www.people.cornell.edu/pages/shb7 >mailto:shb7@cornell.edu ICQ #: 3329174 ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com