We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e2892a commit 87f1ffaCopy full SHA for 87f1ffa
firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/common/util/android.kt
@@ -35,7 +35,6 @@ internal val AudioRecord.minBufferSize: Int
35
*/
36
internal fun AudioRecord.readAsFlow() = flow {
37
val buffer = ByteArray(minBufferSize)
38
- val emptyBuffer = ByteArray(minBufferSize)
39
40
while (true) {
41
if (recordingState != AudioRecord.RECORDSTATE_RECORDING) {
@@ -46,8 +45,6 @@ internal fun AudioRecord.readAsFlow() = flow {
46
45
val bytesRead = read(buffer, 0, buffer.size)
47
if (bytesRead > 0) {
48
emit(buffer.copyOf(bytesRead))
49
- } else {
50
- emit(emptyBuffer)
51
}
52
53
0 commit comments