File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
src/main/kotlin/com/google/firebase/ai/common/util Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 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
1616latestReleasedVersion =17.3.0
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments