Open CyrilleFormont opened 3 years ago
Anyone has an idea on that ?
what format does the opus decoder decode into? I'd guess 16 bit PCM. It should match the format of the BufferedWaveProvider you are writing to or it could be the encode stage. You need to supply the opus encoder with exactly the input format that it is expecting
I recommend doing the following:
That sounds like a plan @markheath, thank you!
Hi Mark, First of all, thank you for your great work!
We created an application that allows users to communicate through an UDP Server using NAudio. We started by creating a P.O.C using WaveIn and WaveOut, we encoded the byte[] using Opus, send that through to the server, the clients received it, that worked. However, the latency was a bit too high for us using WaveIn/Out so we decided to use Asio instead.
We then changed our way to do, we are now using Asio, we convert the float[] to an byte[], send that through the network, the clients gets it, that works perfectly, the latency is perfect and the sound is crystal clear. Only issue there, is that the bandwidth is obviously busy by this transfer of data as we aren't encoding the byte[].
We then tried to encode it using Opus, send it, decode it then, the sound becomes super distorted.
Is there something that comes-up to your mind ?
Here some part of the code that might help:
Sender, Init
Sender, Asio Callback method
Player, Init
Player, OnDataReceived method
WaveFormatCreated