Skip to content

Record Stream returns empty data in the background on Android #488

@bphillips09

Description

@bphillips09

Package version
6.0.0

Environment
Android 14

When the application is put in the background, the stream returns empty data. When it is resumed, stream data is normal.

Example:

final recordStream = await record.startStream(RecordConfig(
  encoder: AudioEncoder.pcm16bits,
  sampleRate: 44100,
  numChannels: 2,
  androidConfig: const AndroidRecordConfig(
    manageBluetooth: false,
    audioSource: AndroidAudioSource.unprocessed,
  ),
  device: device,
));
recordStream.listen((stream) {
  //data here is empty when the application enters the background
});

My use-case is real-time audio playback from a USB audio input device. It works great in all scenarios except when the application is put in the background, though that scenario is crucial as it will be for background music playback.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions