Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with audio codecs #991

Open
joselcv opened this issue Nov 2, 2023 · 10 comments
Open

problem with audio codecs #991

joselcv opened this issue Nov 2, 2023 · 10 comments

Comments

@joselcv
Copy link

joselcv commented Nov 2, 2023

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


@Larpoux
Copy link
Collaborator

Larpoux commented Nov 2, 2023

Valid codecs can be foud here

Do you run on Web Dart or native iOS?

@joselcv
Copy link
Author

joselcv commented Nov 2, 2023

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

@radvansky-tomas
Copy link

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.

@UmairSaqibBhutta
Copy link

same issue

1 similar comment
@renatolealdev
Copy link

same issue

Copy link

github-actions bot commented Mar 6, 2024

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.

@etekumoses
Copy link

This issue is still coming up not sure why

@RitchieP
Copy link

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

@Larpoux
Copy link
Collaborator

Larpoux commented Apr 15, 2024

@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 Larpoux reopened this Apr 15, 2024
@RitchieP
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants