rmbrone / flutter_audio_recorder

Flutter plugin that can support audio recording and level metering
MIT License
119 stars 150 forks source link

On Android setting audioFormat to AAC does not work. (It is still in wav format) #9

Open iNima opened 5 years ago

iNima commented 5 years ago

Hi @nikli2009

I just found another issue. I start recording the audio file with this line of code:

this.audioRecorder = FlutterAudioRecorder(audioVoiceFilePath, audioFormat: AudioFormat.AAC, sampleRate: 44100);
await this.audioRecorder.initialized;
await this.audioRecorder.start();

It works correctly when I do that on iOS and the final recorded file will be in m4a format. I can confirm that by checking the media info of the file in VLC. Screen Shot 2019-10-30 at 12 36 37 pm

The duration of the audio is about 20 seconds and the file size is 220KB. So far so good.

But by the same try on two Android devices I got audio files in wav format although the file extension is still m4a. This is the media info of that file in VLC. Screen Shot 2019-10-30 at 12 36 59 pm

The duration of the audio is about 20 seconds but the file size is 1.8MB.

Could you please check this issue?

Thanks Nima

towerjoo commented 5 years ago

@iNima Android Plugin doesn't support other formats but wav for now. We will try to add the support later. Some background: we internally use this plugin to record some lossless audio so we implement the plugin using the low level AudioRecord class, which makes it a bit difficult to cover multiple formats(since we are handling the bytes directly).

iNima commented 5 years ago

Hi @towerjoo Wow! I think you haven't mentioned it in the README file of the repo.

It would be a deal-breaker since we are using the app on both iOS and Android and the size of the files is really important for us. They are also being synced between devices and backend server so it is important to be consistent in file size/format.

Is there any ETA about supporting AAC on Android? I need to make a decision about using this plugin or not.

Thanks again.

towerjoo commented 5 years ago

@iNima It won't be available within a month I guess, so you might bear this in mind to decide whether to use this plugin or not. BTW, we'll update the doc to make it more accurate. sorry for the confusion.

iNima commented 5 years ago

Thanks @towerjoo for letting me know about this. I switched to another plugin but I'd like to switch back when this feature is ready.

kleinpetr commented 5 years ago

@iNima What plugin you switched?

iNima commented 5 years ago

@kleinpetr https://pub.dev/packages/flutter_sound

sudha-anecure commented 4 years ago

Hi wondering what the ETA for this is?.

Bump!

RaistlinTAO commented 4 years ago

PLEASE UPDATE THE DOCUMENT, I HAVE SPENT HOURS ON INTERGRATION AND DEBUGING ON SERVER PART.

JUST FIND OUT IT IS NOT REAL AAC CODEC? WOW WTF

hnvn commented 4 years ago

I have created a PR to support this feature. You can try it from my fork https://github.com/hnvn/flutter_audio_recorder.git