Canardoux / flutter_sound

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

[HELP]:Unhandled Exception: Instance of '_CodecNotSupportedException' #809

Open quisvox opened 2 years ago

quisvox commented 2 years ago

Here is my question :

I use this code: await _myRecorder.startRecorder( toFile: path, codec: Codec.pcm16, sampleRate: 16000, numChannels: 1);

and Exception

[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Instance of '_CodecNotSupportedException'

flutter_sound is not support PCM ?

ali-1989 commented 2 years ago

me too.

Flutter 2.8.0 on real device (android 7.1)

by all Codecs I get this.

Update:

I realized that the file extension must be compatible with the codec. I think this is an additional operation. Maybe I would like my file extension to be different from codec.

audioRecorder.startRecorder(
        toFile: '$audioRecPath.amr',
          audioSource: AudioSource.microphone,
        codec: Codec.amrWB
      );

This throws an error:

audioRecorder.startRecorder(
        toFile: '$audioRecPath.aac',   <<-- aac
          audioSource: AudioSource.microphone,
        codec: Codec.amrWB          <<-- amr
      );

this is bad. very bad.

Malik056 commented 2 years ago

Yes, same problem, shouldn't depend on the file extension

EuHigorBarbosa commented 2 years ago

Yes, same problem for me, specially on codec: Codec.mp3 For default codec and accMp4 work fine.

Larpoux commented 2 years ago

Record mp3 nor raw pcm are supported. Please refer to https://flutter-sound.canardoux.xyz/guides_codec.html

twopai commented 2 years ago

Record mp3 are also unsupported now

github-actions[bot] commented 9 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.