flutter_sound icon indicating copy to clipboard operation
flutter_sound copied to clipboard

Reduce background noise while recording.

Open AbhishekYadav03 opened this issue 2 years ago • 19 comments
trafficstars

Normalize audio recording or reduce background noise while recording.

Is your feature request related to a problem? Please describe. When I record sound from my flutter app it has a lot of background noise but when I recorded from the default recorder app the sound was very good.

Describe the solution you'd like

await _audioRecorder.startRecorder(
    codec: Codec.aacADTS,
    toFile: audioFile.path,
    audioSource: AudioSource.microphone,
    noiseReduction: true,
);

Describe alternatives you've considered We can convert audio after the recording is completed using ffmpegKit

Additional context This feature will increase sound recording quality.

AbhishekYadav03 avatar Mar 15 '23 10:03 AbhishekYadav03

Hi I also use this package and I solved this issue by increasing the bit rate and sample size. I've noticed that default bit rate and sample size are really low.

rezmeplxrf avatar May 10 '23 14:05 rezmeplxrf

@AbhishekYadav03 I could not find noiseReduction parameter ?

Whether you were able to reduce noise anyhow while recording ?

anukools avatar May 20 '23 09:05 anukools

No, I'm not able to reduce the noise while recording. The noiseReduction: true, is a suggestion.

AbhishekYadav03 avatar Jul 31 '23 09:07 AbhishekYadav03

You could try changing the codec for linear16pcm, with a sample rate of 41000, that works for me.

JUANITOTELO avatar Jul 31 '23 13:07 JUANITOTELO

@AbhishekYadav03 hello , i need your little help with one of your repo , sound recorder, can you please tell me how can i connect with you?

ayesha-119 avatar Oct 10 '23 11:10 ayesha-119

This issue is stale because it has been open 90 days with no activity. Leave a comment or this will be closed in 7 days.

github-actions[bot] avatar Jan 09 '24 01:01 github-actions[bot]

any update on this?

alexgrusu avatar Aug 14 '24 09:08 alexgrusu

Thanks to remind me this point. There are so many Open Issues that I am completely lost in this mess. I restarted the Kanban Table so that it will help me for the project Management. Probably good if Flutter Sound users ping me to remind me that their issues are not yet solved.

For your point, you will see that your issue is in the Todo in 10.0 column : actually I am overloaded with Flutter Sound 9.x maintenance, and I would like to release 10.0 in a not so much long time. So I prefer focus on 10.0 and not do enhancement in 9.x

Larpoux avatar Aug 14 '24 11:08 Larpoux

I've noticed that default bit rate and sample size are really low.

@rezmeplxrf Hey could you tell me what values fixed your problem?? Like how much bitRate and sampleSize reduces the background noise??

Mastermind-sap avatar Mar 22 '25 14:03 Mastermind-sap

Is this thread and #1172 on the same object ?

Larpoux avatar Mar 22 '25 15:03 Larpoux

@Larpoux Yes it is the same. Well increasing the bitRate and sampleSize to 96KHz helped reduce some of the noise. But the more I work on the audio it seems to lag and I get something like Skipped 116 frames! The application may be doing too much work on its main thread..

Also there is huge difference in audio recorded indoors and outdoors, as far as I got to know while using.

Mastermind-sap avatar Mar 22 '25 17:03 Mastermind-sap

Taudio 10.2.2 is released. I implemented two new boolean parameters in startRecorder :

  • enableNoiseSuppression
  • enableEchoCancellation

These parameters are only implemented on Android. If someone desperately needs these parameters on other platforms, please fill an issue on Github

Note 1: I am not able to test the effect of these parameters. Just try and tell me.

Note 2: It is very simple to upgrade to Taudio 10.2.2. Just 5 minutes. You can look to this simple guide

Larpoux avatar Mar 27 '25 08:03 Larpoux

@Larpoux Thats great. I will give it a try and let you know if the effect is working. It would be great if you could make it compatible with iOS also.

Mastermind-sap avatar Mar 27 '25 08:03 Mastermind-sap

I am going to look if we can support those two new parameters on iOS tomorrow.

Larpoux avatar Apr 23 '25 17:04 Larpoux

@Larpoux please make it for iOS 🥇 . I've been using flutter_sound for years and very happy about it, but now I run into a big issue with playing sound while recording :(

truongdo avatar Apr 29 '25 01:04 truongdo

@Larpoux please make it for iOS 🥇

olololoe110399 avatar Apr 30 '25 15:04 olololoe110399

Ok guys and girls, I am going to see what I can do.

Larpoux avatar Apr 30 '25 15:04 Larpoux

Ok guys and girls, I am going to see what I can do.

I waiting for you for finish repo: https://github.com/olololoe110399/ai_assistant Currently, i stop record when playing from response audio. And I try rtc sdk - agora with small code :v

olololoe110399 avatar May 05 '25 17:05 olololoe110399

Ok guys and girls, I am going to see what I can do.

@Larpoux how're things going with noise and echo cancellation for iOS? really hope you can make it in a release soon.

truongdo avatar May 25 '25 13:05 truongdo