Go Down

Topic: 16 bit 44.1khz audio playback - possible? (Read 3883 times) previous topic - next topic

WilliamK Govinda

I have done PWM and seen the new libraries for playing audio at higher rates, but 8 bits only.

So my question is, would it be possible to interface with a DAC and get 16 bits and 44.1khz? (or even +/- 30khz) I really need 16 bits. Haven't tested with 12 bits yet, could work too. But I need to play back the audio (could be RAW format) in stereo.

What I need is this:

- SD Card with the audio data, I don't care if its in RAW, WAV or even MP3
- I need to know once the file ended so I can loop it back to the start with minimal delay possible, so the sound loops nicely. ;-)
- Be able to also change the sound file at the end, so it starts a new sound with no gaps

I'm researching lots of options, but most are a bit expensive for what I need.

Any help will be much appreciated.

I'm also looking at the MP3 codecs, but from what someone told me, there's latency, so I wouldn't be able to loop sounds.

WilliamK Govinda

So far I few options I'm looking at:

- 12-bit DAC with SPI Interface - BUT, will it be able to work together with the SD Card in SPI mode?!
- VS1003B MP3 Board - it has latency before playing a file? (someone told me it has a 20ms latency before it starts playing the file, which is no good)
- ATmega328 (Arduino 2009) at 20Mhz? Would this help? I can make my own boards, as I got the 20Mhz crystal and ATmega328 chips here. ;-)
- LPC NXP Chip instead? Its a much more powerful chip indeed, and it has 2IS interface and SD interface for both DAC and SD Card. But its much more expensive and harder to import. (I'm in Brazil) ;-)

Thanks again!


How much storage do you need  WilliamK?
I've started working on a shield, I guess, with 8 FRAM chips.
3.3V parts 877-FM25H20-G
2V parts 877-FM25V20-G
Both are 256K x 8 with SPI interface
x 16 parts are available too, but parallel interface,
128K x 16 877-FM21L16-60-TG
256K x 16, 512K x 16 also available but only in 48 pin BGA. I suppose have someone solder that onto a breakout board.

Anyway, 1M x 16 would give 23 seconds of playback. Hardly seems worth it for audio use for what it would cost

2M x 16 SRAM, loses the battery-less storage capability would provide 46 seconds of storage, could do 2 for stereo, or go for 92 seconds of sound instead.

Need 21 address lines, 16 data lines, 3 control lines, 1 more for high byte/low byte selection for programming from 8 bit interface.
For audio playback, 3 SPI transfers to  load up a start address, then do continuous dummy reads for as long as the sound lasts to increment the address, load the 16 bit data into the DAC, at the 44.1 Hz rate. Use the rising edge of the CS or Output enable to clock the data into the DAC.
Concept seems simple in my head, am sure will be some gotcha's as the design is worked out.

Alternately, use SD card with data going into FIFOs in 512 byte chunks, refresh the FIFO as it runs low, have separate DAC clock circuit to control FIFO address incrementing. FIFOs are expensive and I think hard to come by tho (or were last time I bought some anyway).

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

WilliamK Govinda

Thanks bud. For now I will hold this project a bit, as I had another one just presented to me by a friend, I just created another post for it.  8)

Best Regards, WilliamK

Go Up