Dynamic decoder for a URL stream? (internet radio supporting both MP3 and AAC) #1531
-
I want to improve my internet radio sketch so it will automatically configure the decoding stream according to the data fetched from the URL. My dream is to support MP3, AAC, and HLS AAC but for now I just want to differentiate MP3 from AAC. (Many streams have no extension, so I can't just check for *.mp3 or *.aac.) I have been following the discussion here about differentiating data over ESP-NOW: #839 but I thought it would be more visible if I started a new topic about urlstreams. I have 1 urlstream and 2 decoders (mp3 and aac) with matching copiers. I plan to select the copier programmatically after checking the format of the urlstream data. I think I can discover the mime type from the copier (copier.copy, then copier.mime) but by then it's too late. Maybe I can parse the http header from the urlstream to choose my copier without having to call a copier first? I'm sorry if I'm missing something obvious. If I can get a push in the right direction I think I can figure it out! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Something like urlstream.httpRequest().reply().get("Content-Type") should work. I never seriously tested this but you can also try out DecoderHelix which should theoretically work as well and support mp3 and aac |
Beta Was this translation helpful? Give feedback.
Something like urlstream.httpRequest().reply().get("Content-Type") should work.
I never seriously tested this but you can also try out DecoderHelix which should theoretically work as well and support mp3 and aac