OGG support in MultiDecoder? #2131
-
I have an Icecast stream receiver application where the sources may be MP3 or OGG format. In recent projects I have used the MultiDecoder class to handle MP3 and AAC (and the amazing new HLS capability too). Now I'm stumbling over ogg support. I've read here that OGG decoding is different than the others, but I'm not sure how to incorporate it into my MultiDecoder structure (with the default automatic mime type detection). If that's not possible, maybe there's a way to hook into the mime detection and switch to a second pipeline / copier when "application/ogg" is detected? I tried a MultiDecoder pattern like below, but it won't compile.
In Setup...
Compiler error:
|
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 5 replies
-
You can try to convert a StreamingDecoder to an AudioDecoder with the help of the DecoderAdapter class. The opposite would be much more efficient: use the new MultiStreamingDecoder class and convert your AudioDecoder to StreamingDecoder with the StreamingDecoderAdapter |
Beta Was this translation helpful? Give feedback.
-
Further attempts (using the last updates from August 16): I ran the OGG sketch from the Streaming Decoding section of the "Encoding and Decoding of audio" wiki page. I think this ran OK a few days ago, but today the codec seems to start but doesn't decode anything:
NOTE: That wiki page needs an update, because the StreamingDecoder methods setInputStream() and setOutputStream() are now renamed to setInput() and setOutput() Ah! I just realized from the commits that you're working on the mime stuff right now. I'll be quiet so I don't add any more noise! |
Beta Was this translation helpful? Give feedback.
-
I committed my final corrections and it should work now:
you can handle both cases with
I also corrected the functionality to notify the output about the actual AudioInfo from the streaming decoder. |
Beta Was this translation helpful? Give feedback.
-
I just re-downloaded the recent changes. Problem persists. Here's my full code in case I'm doing something wrong:
|
Beta Was this translation helpful? Give feedback.
-
I finally managed to resolve the bug when using the MimeDetector: It should work now w/o calling multi.setMimeSource(url); as well... |
Beta Was this translation helpful? Give feedback.
-
Confirmed that it now works without setMimeSource. Thanks |
Beta Was this translation helpful? Give feedback.
You can try to convert a StreamingDecoder to an AudioDecoder with the help of the DecoderAdapter class.
However, I am not sure how reliable this is and there is quite some overhead.
The opposite would be much more efficient: use the new MultiStreamingDecoder class and convert your AudioDecoder to StreamingDecoder with the StreamingDecoderAdapter