Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/07/03 10:36
Read: times


 
#38458 - RE: Is it possible ?
Responding to: ???'s previous message
You probably have read up on the wave file format. It has standard sampling and playback frequency values(11025, 22050, 44100 Hz). Also samples can be either 8 bit or 16 bit, and you can have 1-channel(mono), 2-channel(stereo) etc. data. The total number of bytes played per second is calculated as freq * nBytesPerSample * nChannels. Hence you can choose a single-channel, low frequency and 8-bit sample (for the DAC0808) configuration so that you compromise on quality to bring it within the capabilities of an 8051 + serial port.

In case your choice of channel + freq + sample size doesn't match the configuration of the wave file that you are playing, you will have to run an algorithm to re-sample the file at your frequency, and normalize any 2-channel/16-bit samples to single-channel/8-bit values. This is, of course, best done on the PC side.

Assuming a freq of 11025 (the lowest) and mono-channel 8-bit samples, you need to tranfer bytes over the serial port at a rate of *at least* 11025 bytes per sec. If you use a 12 MHz crystal in mode 0, you will get a max baud rate of 1 MHz, which will easily handle 11.025 Kbytes per sec. In fact at a baud rate of 1 MHz, you could probably easily do a 44.1KHz stereo 16-bit wave file (176400 bytes/sec), but then you'd need a more sophisticated output system (one 16-bit DAC for each channel)

Kundi

List of 17 messages in thread
TopicAuthorDate
Is it possible ?            01/01/70 00:00      
   RE: Is it possible ?            01/01/70 00:00      
      RE: Is it possible ?            01/01/70 00:00      
         RE: Is it possible ?            01/01/70 00:00      
   8052-based MP3 Player Ckt Board            01/01/70 00:00      
   RE: Is it possible ?            01/01/70 00:00      
      RE: Is it possible ?            01/01/70 00:00      
         RE: Is it possible ?            01/01/70 00:00      
            RE: Is it possible ? Jez            01/01/70 00:00      
               RE: Is it possible ? Jez            01/01/70 00:00      
         RE: Is it possible ?            01/01/70 00:00      
   RE: Is it possible ?            01/01/70 00:00      
   RE: Is it possible ?            01/01/70 00:00      
   RE: Is it possible ?            01/01/70 00:00      
   RE: WAV-to-PWM            01/01/70 00:00      
      RE: WAV-to-PWM            01/01/70 00:00      
   RE: WAV to PWM? Andy            01/01/70 00:00      

Back to Subject List