flutter_sound
flutter_sound copied to clipboard
[HELP] AudioCodecInitialize failed on iOS
In my app, when hitting the Record button on iOS I get the error in console: ' AudioCodecInitialize failed '.
I'm using flutter_sound 6.1.2
codec I'm using is Codec.aacADTS
It does work on Android.
Any idea where I should start seeking a solution?
Perhaps you can try to specify a "compiled with version 10.0" inside your Podfile.
You can try also to use Flutter Sound 7.5.1, to see if better... If you want help you must post your logs.
Thank you. Upgrading to 7.5.1 didn't solve.
These are the logs I see in Xcode (maybe I can find more detailed logs somehow):
2021-01-18 09:19:04.864801+0100 Runner[38044:1167257] flutter: recorder
2021-01-18 09:19:04.869950+0100 Runner[38044:1167257] flutter: ----------------------------
2021-01-18 09:19:04.900248+0100 Runner[38044:1165917] IOS:--> setAudioFocus
2021-01-18 09:19:04.900654+0100 Runner[38044:1165917] IOS:--> initializeFlautoPlayer
2021-01-18 09:19:04.901031+0100 Runner[38044:1165917] IOS:<-- setAudioFocus
2021-01-18 09:19:09.178168+0100 Runner[38044:1167257] flutter: Tap down
2021-01-18 09:19:09.187082+0100 Runner[38044:1167257] flutter: Tap up?
2021-01-18 09:19:12.350076+0100 Runner[38044:1165917] AudioCodecInitialize failed
2021-01-18 09:19:12.361405+0100 Runner[38044:1167257] flutter: startRecorder
2021-01-18 09:19:15.369086+0100 Runner[38044:1169538] [ServicesDaemonManager] interruptionHandler is called. -[FontServicesDaemonManager connection]_block_invoke
2021-01-18 09:19:19.617847+0100 Runner[38044:1167257] flutter: Tap down
2021-01-18 09:19:19.622080+0100 Runner[38044:1165917] AudioCodecInitialize failed
2021-01-18 09:19:19.625306+0100 Runner[38044:1167257] flutter: stopRecorder
2021-01-18 09:19:19.626730+0100 Runner[38044:1167257] flutter: ----------------------------
2021-01-18 09:19:19.627058+0100 Runner[38044:1167257] flutter: postwave
2021-01-18 09:19:19.627534+0100 Runner[38044:1167257] flutter: ----------------------------
Perhaps you can try to specify a "compiled with version 10.0" inside your Podfile.
You can try also to use Flutter Sound 7.5.1, to see if better... If you want help you must post your logs.
I am using version 10 (in podfile). Also did not fix
The message AudioCodecInitialize failed
does not seem to be printed by Flutter Sound.
Is it you who print this ? And Why ?
The message
AudioCodecInitialize failed
does not seem to be printed by Flutter Sound. Is it you who print this ? And Why ?
No i'm not printing it (as in i didn't define it in the code somewhere to do it). It happens automatically
I'll try run the example app - to check if it gives the same problem.
warning: the following paths have collided (e.g. case-sensitive paths
on a case-insensitive filesystem) and only one from the same
colliding group is in the working tree:
'doc/pages/flutter-sound/api/wave_header/WaveHeader/writeInt.html'
'doc/pages/flutter-sound/api/wave_header/WaveHeader/writeint.html'
Those two files are generated by dartdoc, It means that someone ( me 👎 ! ) created two functions with almost the same name (probably doing the same thing). Not clean 👎
I am sorry, but actually I am overloaded with too many (unpleasant) tasks. I do not help you as much as I would like. I really need to setup good tools to manage such an important project. And of course, several other developers are terribly missing.
I am in the process of transferring everything out of Github. Github is not Open Source, and τ must not use not Open Source Software.
Alright! I really appreciate your time and help. I'll continue debug myself, so you can focus on other tasks!
I tested recording with the example app on iOS. That works. So it must be my code that has something wrong
I found the issue. It relates to this issue: https://github.com/Canardoux/tau/issues/91
The issue happens when a sampleRate is defined. My code:
await soundRecorder.startRecorder(
//audioSource : AudioSource.defaultSource,
toFile : path,
codec : _codec,
bitRate : 24000,
sampleRate : 44100,
);
When I leave out the sample rate parameter, recording works.
Now, I do want higher quality recording (and not the default 16000). Any tips how to achieve that?
I am very glad that you located the reason of your issue. 👍 I am going to look that.
Note: I thought that "sampleRate" was only for PCM. And "bitRate" was for streaming codecs. But I can be wrong.
Things must be cleaned in this area.
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.