Skip to content

Commit

Permalink
Cherry pick PR #2173: [android] Log the effective size of the AudioTr…
Browse files Browse the repository at this point in the history
…ack buffer (#2313)

Refer to the original PR: youtube/cobalt#2173

Log the effective size of the AudioTrack buffer in bytes that the
application writes to. If we set the buffer size greater than the
maximum size of the AudioTrack, it is different from
audioTrackBufferSize.

b/315159208

Co-authored-by: Bo-Rong Chen <[email protected]>
  • Loading branch information
cobalt-github-releaser-bot and borongc authored Jan 27, 2024
1 parent de262c9 commit 54ff8b9
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 54ff8b9

Please sign in to comment.