Skip to main content
Explorer II
May 16, 2025
Question

Helix MP3 fails to decode audio at 44.1 kHz (OK at 48kHz)

  • May 16, 2025
  • 2 replies
  • 1109 views

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!

    This topic has been closed for replies.

    2 replies

    Technical Moderator
    May 20, 2025

    Hello @Maxime3 

    What "issues", exactly, do you encounter?

    What tests/investigations/debugging have you done to find out what's going on?

    Maxime3Author
    Explorer II
    May 22, 2025

    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?

    Super User
    May 22, 2025

    @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

    https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/tac-p/706966/highlight/true#M49

    Super User
    May 20, 2025

    Are you talking about this: https://github.com/liuduanfei/helix ?

     

    Maxime3Author
    Explorer II
    May 21, 2025

    Yes, i use this library.

    Do you have ideas why it not work ?