You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AudioStreamMicrophone can play its buffer in an infinite loop when it has been turned off and then turned back on. I used to encounter this intermittently, but it is now completely reproducible in a small project.
I tried it in v4.2.1.stable, but here it just keeps switching off after less than a second, so is probably this issue: #86428 The switching off still happens in v4.3.rc2 but not so quickly.
Make an AudioStreamPlayer with an AudioStreamMicrophone, set to Autoplay. Then while it's running call stop() and then play() and the output to the Bus will be a ~0.5second loop of a fragment of recording. (Only happens on Android.)
This bug also manifests in the Quest2 VR headset (which is Android based), but takes a few minutes to go wrong (so I'd hoped it didn't have this problem).
This is a show-stopper for the two-voip plugin, which is intended for multiplayer VR.
According to the source code https://github.com/godotengine/godot/blob/master/platform/android/audio_driver_opensl.cpp#L257 the ring buffer receiving microphone input is 2048 frames, which at 44100Hz is only 0.04 seconds. The looping bug sounds close to 4 times a second, so can't be caused by this ring buffer. (I've not been able to find if other android applications have had this problem with reading the microphone.)
This problem is not happening this way on v4.3.stable (on Android). Instead the AudioStreamPlayer that has the AudioStreamMicrophone is stopping intermittently (sometimes after seconds, and other times after minutes) with AudioStreamPlayer.playing == false.
When I set this value to true (in my Push-To-Talk implementation), it works again for a short duration (doesn't stutter as it used to).
I could make a permanent call-back auto-reset like this:
Tested versions
4.3.rc2
System information
Android version 13
Issue description
AudioStreamMicrophone can play its buffer in an infinite loop when it has been turned off and then turned back on. I used to encounter this intermittently, but it is now completely reproducible in a small project.
I tried it in v4.2.1.stable, but here it just keeps switching off after less than a second, so is probably this issue: #86428 The switching off still happens in v4.3.rc2 but not so quickly.
The following video was recorded off my Android phone as a demo.
https://github.com/user-attachments/assets/bfeea975-3386-4d54-a8ea-9941cf62b250
Steps to reproduce
Make an AudioStreamPlayer with an AudioStreamMicrophone, set to Autoplay. Then while it's running call stop() and then play() and the output to the Bus will be a ~0.5second loop of a fragment of recording. (Only happens on Android.)
Minimal reproduction project (MRP)
lipsyncapp2.zip
The text was updated successfully, but these errors were encountered: