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
I've just started working with this (thank you by the way) and have incorporated trevorirwin's fork for Android/iOS support too
I'm using Murmur and a PC mumble client on the LAN for testing right now with mixed results... I'm tackling output first and getting some rather peculiar results. This is a background service (well, foreground service pretending to be a background service...), the mic and playback do work so that's not an issue it seems.
If I speak into my PC client, it can take upward of 2 seconds to output on the Android device (a Meta Quest 2)
I've abstracted out some of the code but here's the important bits:
publicoverridevoidSetProvider(IWaveProviderprovider){base.SetProvider(provider);this.provider=provider;AudioTrack.Builderbuilder=newAudioTrack.Builder();audioTrack=builder.SetAudioFormat(newAudioFormat.Builder().SetChannelMask(ChannelOut.Mono).SetEncoding(Android.Media.Encoding.Pcm16bit).SetSampleRate(provider.WaveFormat.SampleRate).Build()).SetAudioAttributes(newAudioAttributes.Builder().SetFlags(AudioFlags.LowLatency).SetUsage(AudioUsageKind.VoiceCommunication).SetContentType(AudioContentType.Speech).Build()).SetBufferSizeInBytes(audioBuffer.Length).Build();audioTrack.Play();ThreadplaybackThread=newThread(ReadLoop);playbackThread.Start();Logger.Info("[VOICE] Android Voice Output is ready");}
voidReadLoop(){while(!doStop){if(provider!=null){if(doStop)break;intreadBytes=provider.Read(audioBuffer,0,audioBuffer.Length);if(readBytes==0){Thread.Sleep(1);continue;}if(doStop)break;audioTrack.Write(audioBuffer,0,readBytes);Thread.Sleep(1);// This didn't change anything whether in or not}}}
I get a mixture of massive 2s delay and sometimes the audio skips, which I assume is just where the internal audio buffer gets overwritten before I get a chance to pull from it again perhaps?
Is this something simple I'm missing? I'm fairly new to playing with streamed audio.
The text was updated successfully, but these errors were encountered:
I've just started working with this (thank you by the way) and have incorporated trevorirwin's fork for Android/iOS support too
I'm using Murmur and a PC mumble client on the LAN for testing right now with mixed results... I'm tackling output first and getting some rather peculiar results. This is a background service (well, foreground service pretending to be a background service...), the mic and playback do work so that's not an issue it seems.
If I speak into my PC client, it can take upward of 2 seconds to output on the Android device (a Meta Quest 2)
I've abstracted out some of the code but here's the important bits:
I get a mixture of massive 2s delay and sometimes the audio skips, which I assume is just where the internal audio buffer gets overwritten before I get a chance to pull from it again perhaps?
Is this something simple I'm missing? I'm fairly new to playing with streamed audio.
The text was updated successfully, but these errors were encountered: