diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/media/AudioTrackBridge.java b/starboard/android/apk/app/src/main/java/dev/cobalt/media/AudioTrackBridge.java index d5548648c7526..f110bcd9119dd 100644 --- a/starboard/android/apk/app/src/main/java/dev/cobalt/media/AudioTrackBridge.java +++ b/starboard/android/apk/app/src/main/java/dev/cobalt/media/AudioTrackBridge.java @@ -165,6 +165,9 @@ public AudioTrackBridge( } audioTrackBufferSize /= 2; } + if (isAudioTrackValid()) { + audioTrackBufferSize = audioTrack.getBufferSizeInFrames() * channelCount * getBytesPerSample(sampleType); + } Log.i( TAG, "AudioTrack created with buffer size %d (preferred: %d). The minimum buffer size is"