Skip to content

Commit 2e2892a

Browse files
committed
Update AudioHelper.kt
1 parent b7b0f13 commit 2e2892a

File tree

1 file changed

+2
-2
lines changed
  • firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type

1 file changed

+2
-2
lines changed

firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/AudioHelper.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ internal class AudioHelper(
7474
if (released) return
7575
if (data.isEmpty()) return
7676

77+
if (playbackTrack.playState == AudioTrack.PLAYSTATE_STOPPED) playbackTrack.play()
78+
7779
val result = playbackTrack.write(data, 0, data.size)
7880
if (result > 0) return
7981
if (result == 0) {
@@ -176,8 +178,6 @@ internal class AudioHelper(
176178
AudioManager.AUDIO_SESSION_ID_GENERATE
177179
)
178180

179-
playbackTrack.play()
180-
181181
val bufferSize =
182182
AudioRecord.getMinBufferSize(
183183
16000,

0 commit comments

Comments
 (0)