Canardoux / flutter_sound

Flutter plugin for sound. Audio recorder and player.
Mozilla Public License 2.0
880 stars 575 forks source link

[HELP]: decibel value of recorder onProgress goes up fast but goes down slow #857

Open yusukefs opened 2 years ago

yusukefs commented 2 years ago

Thank you very much for a wonderful project!

I'm trying to visualize the amplitude of the recorded sound. I used onProgress method by calling setSubscriptionDuration in advance.

// _myRecorder is an instance of FlutterSoundRecorder
await _myRecorder.openRecorder();
await _myRecorder.setSubscriptionDuration(const Duration(milliseconds: 10));
_myRecorder.onProgress!.listen((e) {
  print(e.duration);
  print(e.decibels);
});

Although the decibel value goes higher quickly, it goes down slower. Here is the recorded video of the log.

https://user-images.githubusercontent.com/13210107/157698482-37d6d25a-6f07-4c73-a787-97c391a4e740.mov

The decibel value seems to go down after about a second from when the maximum decibel value was observed. I seems like the decibel value is calculated by taking the maximum value from a window of around a second.

Is there any other setting except for the setSubscriptionDuration that I'm missing?

I'm using

Larpoux commented 2 years ago

I am currently working on Taudio. Taudio will be something like a successor of Flutter Sound. With Taudio, the App will be able to receive notifications about what is recording. It will be possible to know not only the global decibel level, but also which frequencies. It will be even possible to do some filtering if some frequencies are too high or too low.

I have great expectations on Taudio. This library will be terrific 🙄

geoox commented 2 years ago

@Larpoux greatly appreciate the effort and looking forward to trying it out :)

github-actions[bot] commented 12 months ago

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.