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
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
Valid codecs can be foud here
Do you run on Web Dart or native iOS?
I'm running it on iOS, of the codecs it supports, none of them work bro 😕😰
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.
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.
This issue is still coming up not sure why
Yes, the issue persists as of now. @joselcv do you have a workaround this?
@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.
Hmmm, guess the problem also exists in Android. I forgot to mention I faced a similar issue in Android
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.
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,
You can refer to this page to know the supported codecs by Flutter Sound
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