Example Request: Unwrapped opus packets to webserver #1013
-
Problem DescriptionHi Phil, I am receiving plain (not wrapped in any container like ogg or mp3) Opus (48000 Hz, 2 channel) UDP packets every 20ms on ESP32 port. Would it be possible to wrap them using ContainerOgg and play them in a browser using this amazing library? Example would be greatly appreciated. Thanks and Best Wishes. Device DescriptionESP32 Sketchno code Other Steps to ReproduceNo response What is your development environmentNo response I have checked existing issues, discussions and online documentation
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I don't quite understand why you report this as a bug, so I convert it into a discussion and I don't see any reason why this should not be possible. Just read the Codec documentation provided in the Wiki and have a look at the corresponding examples and test cases. Usually you would encode PCM data, but if you already have Opus packets, I guess you could use the OggContainerEncoder or OggContainerOutput class to wrap them into Ogg and write the data into a QueuStream. This would then serve as data source for the AudioServer. |
Beta Was this translation helpful? Give feedback.
-
Thanks for quick response. Those packets are available inside of UDP event handler function. How do I convert them into audio source? |
Beta Was this translation helpful? Give feedback.
I don't quite understand why you report this as a bug, so I convert it into a discussion and I don't see any reason why this should not be possible.
Just read the Codec documentation provided in the Wiki and have a look at the corresponding examples and test cases. Usually you would encode PCM data, but if you already have Opus packets, I guess you could use the OggContainerEncoder or OggContainerOutput class to wrap them into Ogg and write the data into a QueuStream. This would then serve as data source for the AudioServer.