2

I'm building a Flutter mobile application for Android. The User Should be able to add filters to the locally saved recorded audio file(.m4a) & should be able to play it after filters are applied. User Can apply filters like changing pitch, changing Voice, Mixing the audio by adding some background music. I don't find any library that supports these features. Anybody can suggest how to approach this ?

ayinala
  • 185
  • 1
  • 12

2 Answers2

1

This can be achieved by using the Just Audio Library for Flutter
https://pub.dev/packages/just_audio.

Effects:.

This package offers different options to play with voice - Change Pitch, Equalizer, Loudness to add effects to the given local audio file / URL.

Background Music:.

To add background music, you can create another instance of a player & start playing some music of your choice while you are playing the main audio file.

ayinala
  • 185
  • 1
  • 12
1

For the future readers -

Just_audio package only supports Pitch, Equalizer etc. effects in Android as per there documentation, also there effects are pretty limited

To achieve these effects in both you need to use combination of FFmpeg and Just_Audio.

In my usecase where I need to add effects to recordings of singing songs by user, I created two audio player, one for recording and one for the background beat and for effects like reverb pitch, I used ffmpeg flutter kit package to do that - https://pub.dev/packages/ffmpeg_kit_flutter

And here are the ffmpeg commands to add reverb, echo, adjust pitch, denoice and many more effects- https://www.vacing.com/ffmpeg_audio_filters/index.html

With the combination of two you can achieve those functionality

  • thanks bro. but any ideas using ffmpeg_kit_flutter without using inputPath/outputPath, but using in byte data like Uint8List ? – mamena tech Aug 21 '23 at 16:45
  • @mamenatech I don't think we can use it with byte data, in my use case I maintained two paths- mainaudiofile and editaudiofile, where I overwrite editaudiofile every time effect is applied and then set the audio path of audio player to editaudioile and if user want to remove audio effect, I simply set it back to mainaudioile. Hope this might help – Akshit Tyagi Aug 22 '23 at 14:10
  • thanks, is there any of your app that i can download? maybe on marketplace? i so curious :D – mamena tech Aug 23 '23 at 17:19
  • Its currently in development and will be post soon on app store. If you are curious send me a mail at akshiittyagi@gmail.com I will send you the video or apk – Akshit Tyagi Aug 25 '23 at 06:48