Recording on Android Emulator stops after 3 seconds
Package version
Environment
- OS: Android Emulator, running from MacOS host
Describe the bug
I start recording, it records audio for about 3 seconds, and then stops recording. I've logged the bytes coming into .listen when I do .startStream and them seem normal for a few seconds and then it's just all 0's.
Record configuration: I can see this behavior with the example/ subdirectory in the repo.
const encoder = AudioEncoder.aacLc; const config = RecordConfig(encoder: encoder, numChannels: 1);
But I've also observed this with pcm16.
To Reproduce
Steps to reproduce the behavior:
- Create and start an Android emulator from Android Studio.
- Select the 'Virtual Microphone uses Host Audio Input' setting inside the emulator.
- Clone https://github.com/llfbandit/record and
cd record/examplewithin the repo. -
flutter run - Try to record something longer than 3 seconds or so.
- Play it back and observed that audio stops after around the 3 second mark.
https://www.loom.com/share/e175f08e5cd240c2ac384efc1c7405fc?sid=b70b83f7-829a-4c24-aa19-4dc73432d69e
Expected behavior
Recording to continue for a longer duration.
Additional context
I'm sure this could be something unique to my machine/setup but I wanted to at least document it here in case somebody else is running into this.