Looking for multiDecoder.h example... #1953
-
re: "(February 2025 #1937) New Functionality: -- new class MultiDecoder to support multiple codecs"...will there be any examples of how to best use this, or can anyone show a simple code snippet as to how to implement? Just discovered these libraries, very impressed and learning a lot...thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
Please check the codec wiki documentation |
Beta Was this translation helpful? Give feedback.
-
Thanks for the response. I've had mixed results with the documentation snippet code. Using the url in the snippet, the function "determineMime" in "MimeDetector.h" usually returns actual_mime = "audio/mpeg" or "audio/aac" as expected and the stream plays audio, but some urls return actual_mime = "" and the serial output is:
Of course, no audio output is generated. But these same urls DO work ok in the audio-tools example sketch "streams-url_aac-i2s.ino". I'm sure I'm overlooking something due to my limited understanding of the library code. I'll keep plugging away. Thanks for any assistance or advice... |
Beta Was this translation helpful? Give feedback.
-
Yes.
Ah, I see you said in the docs: "You can provide the URLStream in the constructor of the MultiDecoder, so that the system can look up the mime type from the http response." I just used the form in the code snippet: "MultiDecoder multi;" This worked ok with the url example in the code snippet: url.begin("http://stream.srg-ssr.ch/m/rsj/mp3_128", "audio/mpeg"); What form should MultiDecoder multi(url) take? None of the following compile:
All of the urls which fail on the code snippet connect and play ok when entered into a browser (Chrome, Safari). Curl output (domain name changed to aacstream, ip addr changed to 555.555.555.555):
For your convenience, this is the code snippet from the documentation. As I said, the only changes I made were to the SSID/password and the url:
Thanks for your patience with me on this... |
Beta Was this translation helpful? Give feedback.
-
No, it is like I wrote;
As you can see, the reply of your url provies the expected mime type:
|
Beta Was this translation helpful? Give feedback.
Please check the codec wiki documentation