Detect HTTP Stream Content Type and change encoder
Posted: Fri Jun 17, 2022 9:57 pm
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?
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?