Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canrt Make esp_flac_dec_decode or MP3 to work at all (AUD-5807) #1302

Open
filzek opened this issue Oct 28, 2024 · 1 comment
Open

Canrt Make esp_flac_dec_decode or MP3 to work at all (AUD-5807) #1302

filzek opened this issue Oct 28, 2024 · 1 comment

Comments

@filzek
Copy link

filzek commented Oct 28, 2024

Can you provide simple example of using:

esp_flac_dec_decode
esp_mp3_dec_decode
esp_aac_dec_decode

As we cant make it to work in esp-idf v5.2.3 or any other.

docs are bad, cant make it sense to work and provide output to i2s

@TempoTian
Copy link
Contributor

If you are just use decoder to decode out pcm, you can use esp_audio_codec directly.
The example code is https://github.com/espressif/esp-adf-libs/blob/master/esp_audio_codec/test_apps/audio_codec_test/main/audio_decoder_test.c#L94

You can replace ret = cfg->read(raw_buf, max_raw_size); to read audio frame data and replace cfg->write(out_frame.buffer, out_frame.decoded_size); to save the decoded PCM data. When using these decoder API directly, make sure the input data is frame boudary.

If you want to input data of any length, you can try to use simple decoder, sample code in https://github.com/espressif/esp-adf-libs/blob/master/esp_audio_codec/test_apps/audio_codec_test/main/simple_decoder_test.c#L170

@github-actions github-actions bot changed the title Canrt Make esp_flac_dec_decode or MP3 to work at all Canrt Make esp_flac_dec_decode or MP3 to work at all (AUD-5807) Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants