2025-05-16 5:21 AM - last edited on 2025-05-20 8:33 AM by Andrew Neil
Hello,
I try to decode MP3 files from SD card using I2S and DMA. It works fine with a sampling rate of 48 kHz, but it fails when using 44.1 kHz.
Specifically, the MP3Decode() function fails to decode the audio at 44.1 kHz.
I have checked the clock configuration and the I2S peripheral settings, but I can’t figure out what causes the failure.
(I use STM32F407vgt6)
Could you please help me understand what might be wrong or how to properly handle 44.1 kHz decoding in this setup?
If someone is interested i can send you the code.
Thank you in advance for your support!
2025-05-20 8:21 AM
Hello @Maxime3
What "issues", exactly, do you encounter?
What tests/investigations/debugging have you done to find out what's going on?
2025-05-20 8:37 AM
Are you talking about this: https://github.com/liuduanfei/helix ?
2025-05-21 9:34 AM
Yes, i use this library.
Do you have ideas why it not work ?
2025-05-22 12:42 AM
Hello @Saket_Om,
When I decode MP3 files, I read the data from the SD card and send it to the decoder. The decoder sometimes fails, and I suspect it's because I'm not feeding it the data correctly.
While debugging, the MP3Decode() function returns errors such as ERR_MP3_INVALID_HUFFCODES or ERR_MP3_INVALID_FRAMEHEADER.
This might be due to the fact that I'm not providing a valid frame using the MP3FindSyncWord() function.
Can I share the code with you in case it helps to understand the issue better?
2025-05-22 12:53 AM
@Maxime3 wrote:While debugging, the MP3Decode() function returns errors such as ERR_MP3_INVALID_HUFFCODES or ERR_MP3_INVALID_FRAMEHEADER.
So have you looked-up what, exactly, those codes mean?
Have you looked into where & why, exactly, those codes are generated.
@Maxime3 wrote:I suspect it's because I'm not feeding it the data correctly.
So what have you done to investigate that hypothesis?
http://www.8052mcu.com/faqs/120313