another wav player using avr query

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hey im a newbie and im working on storing audio on avr. after much perusal this is what i have discerned-

1.i need a 8khz PCM mono .WAV file
2.I need to somehow convert this into a hex file and store it on flash menory/sd card
3.after this i dont know how to actually send it as output to speaker. i use a DAC converter??

please just make things clear to me. im kinda desperate.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

Welcome to AVR-freaks.
You posted your question in the wrong forum. Each forum has a description in a Sticky Topic, found in the top of the Forum. Take a few minutes to familiarize yourself with these guidelines.

I will move your post to the correct forum, and will leave a shadow in this forum: clicking that moved post will bring you to the correct forum.

Tell us what compiler you're using.

Plons
moderator

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What you do for analog conversion depends on the data sample rate and the required audio bandwidth.

If 8KHz PCM means 8KHz sample rate, then you probably have to use a real DAC, not a PWM sorta-DAC. The reason is that your audio bandwidth, even if only "communications quality), is only slightly less than half of the sample rate.

Of course, a PWM could run much faster than the rate of the source data, but the closer the PWM rate is to the audio bandwidth, the harder the system is to achieve (due to filtering requirements).

Your system description is awfully "sketchy" at this point. For example, as far as I know, a wav file is simply a header (that includes sample rate) plus raw (uncompressed) data points. I don't think that PCM even needs to be involved.

You CAN just save a wav file on a PC to the SD card, remove it from the PC and put it into your player. Then, you only need file system code.

Assuming that you can read the SD card, then you need to output the data as analog, and THAT takes a DAC of some kind. Then, you need an audio amplifier to be able to drive the speaker.

I think you need to start experimenting with real hardware rather than fretting over paper exercises. Find out what works and what does not. Find out how to read an SD card. Find out what sort of DAC will meet your needs. Likewise, speaker amplifier.

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey, actually i was trying to implement what's written on these links-

https://www.avrfreaks.net/index.p...

https://www.avrfreaks.net/index.p...