RevoluPowered / one-voip-godot-4

One voip plugin to rule them all
MIT License
49 stars 4 forks source link

Weird crackles in audio #13

Open Akt0o opened 4 months ago

Akt0o commented 4 months ago

Hi, I tried using your VOIP over P2P with Epic Online Services as a relay but the audio that is transferred to the other client has a lot of "crackles" if I can explain it that way.

Here is what it sounds like. https://github.com/RevoluPowered/one-voip-godot-4/assets/116175704/391ad4b2-58fb-46c7-a51b-962c484d748a

Here is what my mic sounds like. https://github.com/RevoluPowered/one-voip-godot-4/assets/116175704/000441e5-cb03-445f-89f6-79abdda25fc2

It may not be an issue related to the VOIP but I have no idea what is causing it so I thought I should ask. Also, it may not be related but the console of godot get spammed with this message :

NOT ENOUGH SAMPLES - frames: 512 num_read: 0 NOT ENOUGH SAMPLES - frames: 512 num_read: 0 NOT ENOUGH SAMPLES - frames: 512 num_read: 0 NOT ENOUGH SAMPLES - frames: 512 num_read: 0

Maybe it's intentional, but I'd rather ask just in case.

marc-weber1 commented 4 months ago

There's still no jitter buffer so I would expect some crackle, but there shouldn't be this much - it sounds a bit like a buffer size issue

if i had some way to reproduce your environment I might be more help, maybe it's just the latency? The NOT ENOUGH SAMPLES message is one I put there to mean the sample buffer isnt collecting packets quickly enough

(if u let me debug thru u by sending u custom builds ilu)

Akt0o commented 4 months ago

Hi, I can try to make a a project that reproduce this and send it to you so you can try it on your side but you'll have to use your own EOS credentials.

However, if latency was the problem, I would have had problems with the other parts of the game (moving, jumping...) but that's not the case, so I don't think latency is the culprit (I could be wrong).

And the message "not enough samples" is spammed a lot, by a lot I mean that in 5 seconds of starting the game I already have 500~ message in the console.

And of course you can send me custom builds to try to debug this if you want.

cgodley commented 2 months ago

I think, unless I missed something, NOT ENOUGH SAMPLES can be caused by not filling the buffer before playback

In other words,

Undefined-array commented 1 month ago

I had the same thing, the solution was making the players AudioStreamVOIP stream local to scene. Seems like godot spawned one object and the players shared it.

marc-weber1 commented 3 weeks ago

If that was the issue, this PR was supposed to fix it: https://github.com/RevoluPowered/one-voip-godot-4/pull/17 Is it still broken on master? What needs to be changed?