record icon indicating copy to clipboard operation
record copied to clipboard

Recording on Android Emulator stops after 3 seconds

Open twitchard opened this issue 1 year ago • 0 comments

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:

  1. Create and start an Android emulator from Android Studio.
  2. Select the 'Virtual Microphone uses Host Audio Input' setting inside the emulator.
  3. Clone https://github.com/llfbandit/record and cd record/example within the repo.
  4. flutter run
  5. Try to record something longer than 3 seconds or so.
  6. 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.

twitchard avatar Oct 16 '24 17:10 twitchard