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

[Android] Audio Recording volume suddenly drops after approximately 3 seconds #404

Open
azrinsani opened this issue Sep 28, 2024 · 3 comments

Comments

@azrinsani
Copy link

azrinsani commented Sep 28, 2024

Package version
record: ^5.1.2

Environment

  • OS: Android 13
  • Google Pixel 4

Describe the bug

Audio Recording volume suddenly drop after recording is started for 3 seconds. So the recorded Audio will have a steady sound and suddenly a drop after about 3 seconds. This happens all the time on this device.

Future<void> startRecording() async { String fileName = '${UserConfig.current.recordedFileNamePrefix}_${DateTime.now().millisecondsSinceEpoch}.${MyRecorder.audioFileExtension}'; String audioFilePath = path.join(Utilities.tmpDir, fileName); await _audioRecorder.cancel(); monitoringStreamStarted = false; await _audioRecorder.start(const RecordConfig(encoder: AudioEncoder.wav), path: audioFilePath); }

I have also tried RecordConfig(encoder: AudioEncoder.wav, autoGain: true, androidConfig: AndroidRecordConfig(useLegacy: true)) and changing the encoder to AAC, yet the same problem occurs

Note: Other android recording apps on this phone works fine

To Reproduce

Steps to reproduce the behavior:

  1. Create a new Recorder
  2. Create a new RecordingConfig
  3. Start recording with config
  4. Stop recording
  5. Try to listen to recorded file

Expected behavior

Recorded volume should be consistent

@renancaraujo
Copy link
Contributor

Low volume on android is also a problem on my tests on two different devices (Samsung s21 ultra and Xperia 1 IV)

@Sesa1988
Copy link

Sesa1988 commented Oct 6, 2024

Low volume on android is also a problem on my tests on two different devices (Samsung s21 ultra and Xperia 1 IV)

I also have this issue on S23+. My recording is low volume in general but it seems fine on Windows.

I do nothing special here:

await recorder.start(
          const RecordConfig(
            encoder: AudioEncoder.aacLc,
          ),
          path: fullfilePath);

There is a workaround with useLegacy: true on Android.

@llfbandit
Copy link
Owner

legacy uses default audio source. This is now the default source for both recorder implementations.
Also, source is now added to android config from 450db60 to mitigate constructor implementations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants