roc-streaming / roc-toolkit

Real-time audio streaming over the network.
https://roc-streaming.org
Mozilla Public License 2.0
1.09k stars 213 forks source link

Implement IFrameEncoder / IFrameDecoder using libopus #757

Open gavv opened 4 months ago

gavv commented 4 months ago

We have two interfaces IFrameEncoder and IFrameDecoder that are used to encode audio samples into packet payload and decode it back. Currently they're implemented using PcmEncoder and PcmDecoder (for uncompressed PCM).

Now we need to add two more implementations: OpusEncoder and OpusDecoder, that will use libopus library to do the job.

We also need to add new encoder & decoder to the list of tested codecs in test_frame_encoder_decoder.cpp.

Nystana commented 1 month ago

Hello I'd like to try this issue

gavv commented 1 month ago

Great, thank you!

gavv commented 1 month ago

@Nystana Please check out discussion here: https://github.com/roc-streaming/roc-toolkit/issues/758

It uncovered a few gotchas that are likely the same for opus and vorbis (related to variable packet size), which were not addressed yet.

@runei Leonardo, what are your thoughts/plans regarding those changes needed in encoder/decoder interfaces? Should we wait until that is resolved in libvorbis PR, or work on it in libopus PR?

runei commented 1 month ago

Hi @gavv

I didn't work on this through the past weeks as I have been busy, so I can't give many insights abouts your comments yet. If you want to work in this on libopus, thats fine, I can wait and continue later. Or if you want to wait, I will continue this when I have more time. You and @Nystana can decide what you prefer, I'm fine with both options.