flutter_sound icon indicating copy to clipboard operation
flutter_sound copied to clipboard

[BUG]:Codec Codec.aacMP4 is not supported on Android.

Open akshg05 opened this issue 3 years ago • 3 comments
trafficstars

Flutter Sound Version :

  • FULL or LITE flavor ?

  • Important: Result of the command : flutter pub deps | grep flutter_sound


Severity

  • Crash ?

  • No crash

  • Result is not what expected ?

  • I am getting Codec not supported. Using the codec Codec.aacMP4 on Android.

  • Cannot build my App ?

  • Minor issue ?


Platforms you faced the error

  • iOS ? No

  • Android ? Yes

  • Flutter Web ?

  • Emulator ? No

  • Real device ? Yes


Describe the bug A clear and concise description of what the bug is.

Trying recording by providing the codec as Codec.aacMP4. Exception is thrown as Codec not supported. Recording works fine with default codec. MinSdk version is 23 and Android version of device is 10

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Logs!!!!

(This is very important. Most of the time we cannot do anything if we do not have information on your bug). To activate the logs, you must instantiate your modules with the Log Level set to Level.debug :

I/flutter (27730): │ 🐛 FS:---> _startRecorder. I/flutter (27730): └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── E/flutter (27730): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Instance of '_CodecNotSupportedException' E/flutter (27730): #0 FlutterSoundRecorder._startRecorder

FlutterSoundPlayer myPlayer = FlutterSoundPlayer(logLevel: Level.debug);
FlutterSoundRecorder myRecorder = FlutterSoundRecorder(logLevel: Level.debug);

See this


akshg05 avatar Apr 17 '22 12:04 akshg05

Alright, I figured it out and it's a bit funny that I was getting that error as I did not append the extension ie. ".mp4" at the end of my file name. I think file name should not be used to determine a Codec's support. "What's in a name?" .. to quote Shakesspeare here :p

akshg05 avatar Apr 17 '22 15:04 akshg05

I think file name should not be used to determine a Codec's support.

Yes, myself I thought also that the file name was not used to determine the codec. But several Flutter Sound users have actually problems when the file extension is not consistent withe encoded data. Specifically when the extension is '.aac' but the codec is AAC/MP4 and not AAC/ADTS.

I guess that the file name is probably important even if Shakespeare does not agree 😆

Larpoux avatar Apr 17 '22 15:04 Larpoux

Haha well may be you could find a way out keeping both the sects of users happy. Thanks for the library tho!

akshg05 avatar Apr 17 '22 15:04 akshg05

Is the extension .m4a good for Codec.aacMP4 for example 'filename.m4a'?

HasanAlyazidi avatar Mar 05 '23 13:03 HasanAlyazidi

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 Dec 04 '23 01:12 github-actions[bot]