Page 1 of 1

Play wave file from SD card

Posted: Mon Oct 12, 2020 6:16 am
by saeed144
Hi everyone
I'm going to make a wave player with my BluePill
BluePill does not have DAC so I have to use PWM
What shoud I do? can anyone help guide me and show the steps?

Re: Play wave file from SD card

Posted: Mon Oct 12, 2020 2:50 pm
by mrburnette
Not specific to .wav, but old forum had MP3 info:

https://www.google.com/search?q=MP3+sit ... oforum.com

http://stm32duinoforum.com/forum/viewtopic.php?t=243

Also, the massive STM32 thread on Arduino.cc has some posts.
Construct your Google query as:
stm32 + WAV site:forum.arduino.cc

Ray

Re: Play wave file from SD card

Posted: Tue Oct 13, 2020 4:44 am
by saeed144
Actually I don't want to use any extra module , micro has to decode the wave file , I read the MP3 topic but that's a little bit different abut what I want

Re: Play wave file from SD card

Posted: Tue Oct 13, 2020 4:25 pm
by mrburnette
AN3126
2.2.3 .WAV file format
The .WAV file format is a subset of the Resource Interchange File Format (RIFF)
specification used for the storage of multimedia files. A RIFF file starts with a file header
followed by a sequence of data chunks. A .WAV file is often just a RIFF file with a single
"WAVE" chunk consisting of two sub-chunks:
1. a fmt chunk, specifying the data format
2. a data chunk, containing the actual sample data.
The WAVE file format starts with the RIFF header: it indicates the file length.
Next, the fmt chunk describes the sample format, it contains information about the format of
the wave audio (PCM / ...), the number of channels (mono/stereo), the sample rate (number
of samples per seconds, e.g. 22050), and the sample data size (e.g. 8 bit / 16 bit). Finally,
the data chunk contains the sample data.
Googling around, it seems the F4 has some examples.

STM32-centric HAL WAV library

Re: Play wave file from SD card

Posted: Sun Oct 18, 2020 4:29 pm
by saeed144
They use I2S , but I don't want to use I2S, micro controller should decode wave file and play it with PWM or DAC(PWM is desired because my STM32F103C8T6 doesn't have DAC)