Currently, I am working on an application that is taking a stream of audio (RAW encoded bytes) and is applying some transformations to it (resampling, converting stereo to mono etc..). I have implemented encoding raw bytes using opus codec thanks to JNI
but I have a little problem:
Is there a way to listen to opus encoded stream saved to a file? I am aware that if I add some file headers and do some additional operations I should be able to save it as OGG file, but I do not want to waste time implementing functionality just to listen audio in the test.
Ideally, I would like to find a tool that would be able to play such stream, like audacity is playing RAW
(after adding encoding parameters of course).
Thank you.
Did you try the opusdec utility from the OPUS tools package?
This utility should allow you to take opus stream and play it out as PCM encoded wav file which you should be able to pipe to a command-line .wav player and listen to it. No need for any implementation, just a shell command executed via Runtime.Exec(), Should do it
e.g. For a system with pulseaudio installed
yourstream.opus | padsp opusdec -
if no pulseaudio any wav player can use the wav stream output and play it. For e.g.
opusdec --force-wav yourinput.opus - | <YOUR WAV Stream Accepting Player>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With