llfbandit / record

Audio recorder from microphone to a given file path. No external dependencies, MediaRecorder is used for Android an AVAudioRecorder for iOS.
https://pub.dev/packages/record
245 stars 203 forks source link

Recorded files are too low volume #398

Closed echogit closed 2 months ago

echogit commented 2 months ago

I'm using the latest version version of the package.

On iOS it worked fine, but on Android, the volume of the recorded file is too low. I tried different encodings (aar, wav, flac), but that didn't helped as well.

I tried putting on the maximum volume for reproduction and still it's very low.

Is there any way to increase the volume used for recording?

Environment

Describe the bug

A clear and concise description of what the bug is.

Add your record configuration RecordConfig(...)

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Additional context

Add any other context about the problem here.

llfbandit commented 2 months ago

Unfortunately no, there's no way to play with hardware microphone sensivity. You can try with autoGain flag, it may help. This is very device/vendor dependent.

Also you can try with the recorder app shipped with your phone (if available), it should output the same as this package.

echogit commented 2 months ago

Unfortunately no, there's no way to play with hardware microphone sensivity. You can try with autoGain flag, it may help. This is very device/vendor dependent.

Also you can try with the recorder app shipped with your phone (if available), it should output the same as this package.

That's the thing, I initially used the flutter_sound package to record sound, but it didn't worked on iOS, as it was creating corrupted empty files. Then I changed to Record package, and worked just fine on iOS. When I went back to Android to confirm it was also working fine, I found out that the sound recorded is very very low. I tried the auto gain parameter, which didn't make any difference.

Would you have any idea what I could do?

echogit commented 2 months ago

I found the problem, it fixed when I used the useLegacy parameter to true:

RecordConfig(autoGain: true, encoder: encoder, numChannels: 1, androidConfig: AndroidRecordConfig(useLegacy: false, muteAudio: false), );

mityax commented 2 months ago

I also have this issue and I think it would be great if there was a way to fix this without using a legacy feature

rulefahd commented 3 weeks ago

any fix !?!? many devices have very low volume on recording , including s24 !