Hi I am working on an audio streaming device that provides streams in two formats opus and mp3. when connecting to a stream i need to detect the audio format and load the correct decoder.
I have used the examples from the esp-adf to create the pipeline and confirm that I am able to stream either mp3 or opus separately. But i'm having trouble detecting the audio type before initialising the decoder and linking up the pipeline.
I have not been able to find any examples that have this type of functionality, to change the encoder to suit the stream audio format. All the examples assume a static decoder type.
Does anyone have an idea on how to setup the pipeline to be able to change the decoder on the fly if the stream audio format changes?
Detect HTTP Stream Content Type and change encoder
-
- Posts: 40
- Joined: Wed Jun 22, 2022 12:10 pm
Re: Detect HTTP Stream Content Type and change encoder
Opus always encapsulated in OGG container.
It is easy to check file header to determine whether it is opus or mp3.
Ex: Opus starts with "oggS" and "OpusHead" while mp3 starts with "ID3" or 0xFF.
It is easy to check file header to determine whether it is opus or mp3.
Ex: Opus starts with "oggS" and "OpusHead" while mp3 starts with "ID3" or 0xFF.
-
- Posts: 25
- Joined: Fri Nov 23, 2018 12:07 pm
Re: Detect HTTP Stream Content Type and change encoder
Maybe ADF could do this for you! Please refer: https://github.com/espressif/esp-adf/tr ... ct_decoder
Who is online
Users browsing this forum: No registered users and 53 guests