Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected stereo output on Android devices when configuring mono audio recording #289

Closed
tobit0101 opened this issue Feb 23, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@tobit0101
Copy link

Package version

  • Record package version: 5.0.4
  • Flutter version: 3.19.1
  • Android device: Samsung Galaxy Note 20 Ultra
  • iOS device: iPhone 14 Pro

Environment

  • OS: Android/iOS

Describe the bug

I've encountered an issue with the record package where recording audio in mono configuration results in stereo output on Android devices, specifically tested on a Samsung device. The configuration is intended for mono output with settings: bitrate of 128000, sample rate of 44100, using AAC encoder, and 1 channel. However, the output audio file is in stereo format. This behavior differs from iOS, where the output is correctly in mono. This discrepancy in audio channel output across platforms could affect applications relying on consistent audio formats.

import 'package:record/record.dart';

final recorder = Record();
await recorder.start(
  path: 'path/to/output/file.m4a',
  encoder: AudioEncoder.aacLc,
  bitRate: 128000,
  samplingRate: 44100,
  numChannels: 1,
);

// Later, to stop the recording
await recorder.stop();

To Reproduce

  1. Configure the audio recording to use mono output settings in a Flutter app.
  2. Start the recording with the specified mono configuration.
  3. Stop the recording and inspect the output file's channel configuration.

Expected behavior

Expected Behavior:
The recording should be in mono format with a single audio channel, as specified in the configuration.

Actual Behavior:
On Android devices, specifically tested on Samsung, the output file is unexpectedly in stereo format with two audio channels, despite the mono configuration. This behavior is inconsistent with iOS, where the output correctly matches the mono configuration.

Logs:
logs.log

@llfbandit
Copy link
Owner

Thanks for the report. Sample rate et num channels properties are not applied for AAC profiles.

@llfbandit llfbandit added the bug Something isn't working label Feb 23, 2024
@tobit0101
Copy link
Author

Sorry to bother you, when can we expect the release? Would help us very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants