Basic example for mp3 from sd card

escalator
Posts: 5
Joined: Tue May 29, 2018 11:01 am

Basic example for mp3 from sd card

Postby escalator » Tue May 29, 2018 11:25 am

Hi,
I followed the examples included in esp32-adf sdk for single file mp3 playing from the sd card using an audio pipeline, it works well.
But I would like to know how is the correct sequence to jump from file to file if you have many files on sd card during play not only a single file as the example.
I cant find information enough in the documentation to know a step procedure to avoid hangs and errors to manipulate the pipeline or the audio elements involved when I try to switch from file to file without doing a reset.
If someone knows can give some advice or a basic diagram for the right procedure?

Thanks

User avatar
ESP_krzychb
Posts: 400
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: Basic example for mp3 from sd card

Postby ESP_krzychb » Wed May 30, 2018 8:37 am

escalator wrote:I would like to know how is the correct sequence to jump from file to file if you have many files on sd card during play not only a single file as the example.
Hi escalator,

Check periph_console example that shows how to jump from file to file.

escalator
Posts: 5
Joined: Tue May 29, 2018 11:01 am

Re: Basic example for mp3 from sd card

Postby escalator » Wed May 30, 2018 9:25 am

Hi krzychb,
Big thanks for the advice.
But maybe I did not express myself correctly. I understand how to select between files inside the SD but my question is more about the right steps needed to reset the pipeline between file switching (pipeline run, stop, resume, init , terminate,etc...)or to automatically play the next file when one is finished. I did not see any example of pipeline management between file playing except to destroy all the elements in the pipeline and restart from scratch.
In the test that I am trying my audio_pipeline is: (sdcard)->fatfs_stream_reader -> mp3_decoder -> i2s_stream_writer->(DAC)
So when initial file finishes playing I want to switch to another file and keep playing, I know how to change the "uri" for the fatfs_stream_reader to point to the next file but I have no idea about how to reset the audio elements involved or the audio_pipeline in the proper order to keep playing without interruptions or resets.

User avatar
ESP_krzychb
Posts: 400
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: Basic example for mp3 from sd card

Postby ESP_krzychb » Tue Jun 26, 2018 7:34 am

escalator wrote:my question is more about the right steps needed to reset the pipeline between file switching (pipeline run, stop, resume, init , terminate,etc...)or to automatically play the next file when one is finished.
Hi @escalator,

I was also looking for an application that would illustrate such steps :D. Please check pipeline_sdcard_mp3_control example that was merged today and hopefully answers your questions.

escalator
Posts: 5
Joined: Tue May 29, 2018 11:01 am

Re: Basic example for mp3 from sd card

Postby escalator » Tue Jun 26, 2018 8:22 am

Hi @krzychb:
Thanks for your info, you are right, that example includes the answer to my question. :)

Who is online

Users browsing this forum: No registered users and 70 guests