Keep outgoing voice smooth over long sessions
Drain live mic frames each tick, raise capture priority, and hold a high-performance Wi-Fi lock on Android so power saving stays off in the background. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -309,6 +309,8 @@ public final class CaptureVoiceInput implements VoiceInput {
|
||||
running.set(true);
|
||||
captureThread = new Thread(this::captureLoop, "ts3j-mic-capture");
|
||||
captureThread.setDaemon(true);
|
||||
// Falling behind overruns the device's buffer, losing audio.
|
||||
captureThread.setPriority(Thread.MAX_PRIORITY);
|
||||
captureThread.start();
|
||||
}
|
||||
|
||||
@@ -562,6 +564,11 @@ public final class CaptureVoiceInput implements VoiceInput {
|
||||
return transmitting.get() || !queue.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLiveCapture() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CodecType getCodec() {
|
||||
return codec;
|
||||
|
||||
Reference in New Issue
Block a user