2023-01-22 08:42 PM
Can anyone suggest me some easy tips/libraries to play or decode those mp3 files to the speaker.
Solved! Go to Solution.
2023-01-23 12:30 AM
Hello @SGoel.2,
just to clarify the steps for you, so you can have some insights on how to dot it
To play MP3 files from an SD card attached to an STM32G071RB MCU :
Hope that helps!
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-01-22 11:27 PM
this is not easy...i have a player running, but on H743 cpu; also on F411 , but RAM was almost used up here. MP3 decoder use about 10% cpu time on H743 at 200MHz, so expect about 60% cpu on this small 64MHz cpu, + time for reading from SDcard (without SDIO controller - i never tried);
so this cpu is on limits for MP3 music player. i would recommend other cpu, if you want ready to run examples, look for Arduino and faster cpu, maybe something like ESP32 .
but if you want try on this cpu, here some info:
i use mp3 decoder from here: https://github.com/lieff/minimp3
but on small cpu without float unit, better use : https://keyj.emphy.de/minimp3/
or look here : https://www.underbit.com/products/mad
or try using the lib from STM example: STM32 Audio MP3 Decoder Library - no, i see: This package includes MP3 Decoder libraries, depending on the STM32 device core: it supports STM32 devices with CortexM3, CortexM4 and CortexM7 cores. -- need bigger cpu .
so try minimp3 or take bigger and faster cpu, stm32F411 has SDIO and float, much better preconditions for mp3-decoder project.
2023-01-23 12:30 AM
Hello @SGoel.2,
just to clarify the steps for you, so you can have some insights on how to dot it
To play MP3 files from an SD card attached to an STM32G071RB MCU :
Hope that helps!
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-01-23 12:50 AM
On step5, depends of what he is using to output the audio.
If its a hardware audio codec then DMA+I2C
If its just an amplifier then DMA+DAC
2023-01-23 01:32 AM
Sure! you're right
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-01-23 08:54 PM
Hello @Saara.S & @Javier, Thank you for your information, I have understood your reply, as you said:
2023-01-30 01:58 AM
According to your message i have initialized the DMA & DAC for output the PCM samples and also added the libmad library for decoding the mp3 audio in my code but can u suggest me some sample program based on Libmad library to do the decoding and store it on buffer for sending to output device.
@Community member also can u please help me regarding this.