Skip to content

Commit 082c510

Browse files
committed
update
1 parent ffa0ce9 commit 082c510

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

firebase-ai/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
version=99.9.9
15+
version=99.9.0
1616
latestReleasedVersion=17.3.0

firebase-ai/src/main/kotlin/com/google/firebase/ai/common/util/android.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ internal val AudioRecord.minBufferSize: Int
3737
*
3838
* Will yield when this instance is not recording.
3939
*/
40-
internal fun AudioRecord.readAsFlow() = callbackFlow {
40+
internal fun AudioRecord.readAsFlow() = flow {
4141
val buffer = ByteArray(minBufferSize)
4242

43-
while (isActive) {
43+
while (true) {
4444
if (recordingState != AudioRecord.RECORDSTATE_RECORDING) {
4545
delay(0)
4646
continue
4747
}
4848
val bytesRead = read(buffer, 0, buffer.size)
4949
if (bytesRead > 0) {
50-
send(buffer.copyOf(bytesRead))
50+
emit(buffer.copyOf(bytesRead))
5151
}
5252
delay(0)
5353
}

0 commit comments

Comments
 (0)