flutter_sound icon indicating copy to clipboard operation
flutter_sound copied to clipboard

problem with audio codecs

Open joselcv opened this issue 1 year ago • 10 comments

Flutter Sound Version :

  • Flutter 3.13.9 • channel stable •?

  • Important: Result of the command : flutter pub deps | grep flutter_sound ├── flutter_sound 9.2.13 │ ├── flutter_sound_platform_interface 9.2.13 │ ├── flutter_sound_web 9.2.13 │ │ ├── flutter_sound_platform_interface...


Severity

  • Crash ?

Platforms you faced the error

  • iOS
  • Real device iphone 11 (ios 17.0.3)

Describe the bug When I try to record audio with: FlutterSoundRecorder recordAudio = FlutterSoundRecorder();

playFunction()async{ await recordAudio.openRecorder(); await recordAudio.startRecorder(toFile: '${folder.path}/myFile'); }

and do not specify the codec parameter, it returns an apparently empty .bin file, if I try to specify any of the codec (Codec.aacMP4, Codec.pcm8) etc. an error appears saying that these codecs are not compatible with the platform


Logs!!!!

lutter: ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── flutter: │ #0 FlutterSoundRecorder.openRecorder package:flutter_sound/public/flutter_sound_recorder.dart:372 flutter: │ #1 _ChatScreenState.build. package:prosafe/…/chat/chat_screen.dart:167 flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ flutter: │ 🐛 FS:---> openAudioSession flutter: └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── flutter: ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── flutter: │ #0 FlutterSoundRecorder._openAudioSession package:flutter_sound/public/flutter_sound_recorder.dart:381 flutter: │ #1 FlutterSoundRecorder.openRecorder. package:flutter_sound/public/flutter_sound_recorder.dart:374 flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ flutter: │ 🐛 ---> openAudioSession flutter: └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── flutter: ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── flutter: │ #0 FlutterSoundRecorder._openAudioSession package:flutter_sound/public/flutter_sound_recorder.dart:396 flutter: │ #1 FlutterSoundRecorder.openRecorder. package:flutter_sound/public/flutter_sound_recorder.dart:374 lutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ flutter: │ 🐛 Resetting flutter_sound Recorder Plugin flutter: └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── flutter: ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── flutter: │ #0 FlutterSoundRecorder.openRecorderCompleted package:flutter_sound/public/flutter_sound_recorder.dart:171 flutter: │ #1 MethodChannelFlutterSoundRecorder.channelMethodCallHandler package:flutter_sound_platform_interface/method_channel_flutter_sound_recorder.dart:98 flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ flutter: │ 🐛 ---> openRecorderCompleted: true flutter: └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── flutter: ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── flutter: │ #0 FlutterSoundRecorder.openRecorderCompleted package:flutter_sound/public/flutter_sound_recorder.dart:182 flutter: │ #1 MethodChannelFlutterSoundRecorder.channelMethodCallHandler package:flutter_sound_platform_interface/method_channel_flutter_sound_recorder.dart:98 flutter: 🐛 <--- openRecorderCompleted: true flutter: └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── flutter: ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── flutter: │ #0 FlutterSoundRecorder._openAudioSession package:flutter_sound/public/flutter_sound_recorder.dart:412 flutter: │ #1 flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ flutter: │ 🐛 <--- openAudioSession flutter: └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── flutter: ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── flutter: │ #0 FlutterSoundRecorder.openRecorder package:flutter_sound/public/flutter_sound_recorder.dart:376 flutter: │ #1 flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ lutter: │ 🐛 FS:<--- openAudioSession flutter: └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── flutter: ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── flutter: │ #0 FlutterSoundRecorder.startRecorder package:flutter_sound/public/flutter_sound_recorder.dart:590 flutter: │ #1 _ChatScreenState.build. package:prosafe/…/chat/chat_screen.dart:168 flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ flutter: │ 🐛 FS:---> startRecorder flutter: └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── flutter: ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── flutter: │ #0 FlutterSoundRecorder._startRecorder package:flutter_sound/public/flutter_sound_recorder.dart:614 flutter: │ #1 FlutterSoundRecorder.startRecorder. package:flutter_sound/public/flutter_sound_recorder.dart:592 flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ lutter: │ 🐛 FS:---> _startRecorder. flutter: └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── [VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: Instance of '_CodecNotSupportedException' #0 FlutterSoundRecorder._startRecorder package:flutter_sound/public/flutter_sound_recorder.dart:643 #1 FlutterSoundRecorder.startRecorder. package:flutter_sound/public/flutter_sound_recorder.dart:592 #2 BasicLock.synchronized package:synchronized/src/basic_lock.dart:33 #3 FlutterSoundRecorder.startRecorder package:flutter_sound/public/flutter_sound_recorder.dart:591


joselcv avatar Nov 02 '23 18:11 joselcv

Valid codecs can be foud here

Do you run on Web Dart or native iOS?

Larpoux avatar Nov 02 '23 19:11 Larpoux

I'm running it on iOS, of the codecs it supports, none of them work bro 😕😰

joselcv avatar Nov 02 '23 20:11 joselcv

Same here, I am trying to run startPlayerFromStream and every combination of codecs crash the simulator. And in xcode it says that there is invalid format/number of channels.

radvansky-tomas avatar Nov 03 '23 06:11 radvansky-tomas

same issue

UmairSaqibBhutta avatar Jan 07 '24 05:01 UmairSaqibBhutta

same issue

renatolealdev avatar Jan 22 '24 16:01 renatolealdev

This issue is stale because it has been open 365 days with no activity. Leave a comment or this will be closed in 7 days.

github-actions[bot] avatar Mar 06 '24 01:03 github-actions[bot]

This issue is still coming up not sure why

etekumoses avatar Apr 03 '24 13:04 etekumoses

Yes, the issue persists as of now. @joselcv do you have a workaround this?

RitchieP avatar Apr 15 '24 12:04 RitchieP

@RitchieP , @joselcv

I think that there is a big problem with Play from Stream and Record to Stream on iOS. It used to work fine, but it doesn’t anymore in the last versions.

This is really bad because I think Sound with Streams is a very important feature. I spent several days fighting to debug this issue, but was not successful. I don’t have time to work further on Flutter Sound maintenance and someone one else should work on this issue.

I am very sorry for that.

Larpoux avatar Apr 15 '24 17:04 Larpoux

Hmmm, guess the problem also exists in Android. I forgot to mention I faced a similar issue in Android

RitchieP avatar Apr 16 '24 03:04 RitchieP

Still same problem

abdullhasseeb avatar Jul 10 '24 15:07 abdullhasseeb

Please, create a new issue explaining your problem, with logs, your platform, your Flutter Sound version, … Flutter Sound is supposed to work both on Android and iOS. This issue is old, and I can’t understand really your problem.

Larpoux avatar Jul 10 '24 15:07 Larpoux

Default codec is recording very low quality sound so I want to change codec but when I use codec like aacADTS, aacMP4 or any other , I got issue (Instance of '_CodecNotSupportedException')

But if I don't specify any codec then codec will be default and its working fine with default codec,

abdullhasseeb avatar Jul 10 '24 15:07 abdullhasseeb

You can refer to this page to know the supported codecs by Flutter Sound

Larpoux avatar Jul 10 '24 15:07 Larpoux

Yes I have seen these supported codec, as mentioned in supported codec that aacADTS is working for all platforms but even i got same error, I had not tried only one I have tried all of codec but none of them working, just default is working fine

abdullhasseeb avatar Jul 10 '24 16:07 abdullhasseeb