theolm / kmp-record

MIT License
5 stars 2 forks source link

Recording failed on iOS #1

Closed leon-jakob-schneider closed 1 week ago

leon-jakob-schneider commented 2 months ago

Here are the logs: AddInstanceForFactory: No factory registered for id <CFUUID 0x6000002f4060> F8BB1C28-BAE8-11D6-9C31-00039315CD46 AudioQueueObject.cpp:1580 BuildConverter: AudioConverterNew returned -50 from: 0 ch, 44100 Hz, .... (0x00000000) 0 bits/channel, 0 bytes/packet, 0 frames/packet, 0 bytes/frame to: 1 ch, 44100 Hz, aac (0x00000000) 0 bits/channel, 0 bytes/packet, 1024 frames/packet, 0 bytes/frame AudioQueueObject.cpp:6708 ConvertInput: aq@0x1088e8200: AudioConverterFillComplexBuffer returned -50, packetCount 21 Uncaught Kotlin exception: dev.theolm.record.error.RecordFailException: Could not record audio

I will do some more debugging when I have more time.

theolm commented 2 months ago

I have the same error on the simulator. It works on a physical device. Even though I found information saying otherwise, I suspect that the ios simulator does not support mic recording.

please try to build/run on a device.

leon-jakob-schneider commented 1 month ago

Also crashes on real device: RecordConfig(outputLocation=Cache, outputFormat=MPEG_4, audioEncoder=AAC) Uncaught Kotlin exception: dev.theolm.record.error.RecordFailException: Could not record audio at 0 SailSmart.debug.dylib 0x10af013d7 kfun:kotlin.Throwable#(kotlin.String?){} + 119 at 1 SailSmart.debug.dylib 0x10aefaa4f kfun:kotlin.Exception#(kotlin.String?){} + 115 at 2 SailSmart.debug.dylib 0x10bbb4b9f kfun:dev.theolm.record.error.RecordFailException#(){} + 75 at 3 SailSmart.debug.dylib 0x10bbb5813 kfun:dev.theolm.record.RecordCore#startRecording(dev.theolm.record.config.RecordConfig){} + 2167 at 4 SailSmart.debug.dylib 0x10bbb299b kfun:dev.theolm.record.Record#startRecording(){} + 167

mrljdx commented 1 month ago

I had a similar problem and added a retry method to startRecording to fix it

mrljdx commented 1 month ago

@theolm @leon-jakob-schneider The question I recently settled, you can take a look at this PR https://github.com/theolm/kmp-record/pull/3 Wait for Maintainer to merge the request

theolm commented 1 month ago

@mrljdx Thanks for fixing this issue. Feel free to open more PRs... Unfortunately, I don't have enough time to dedicate to this lib =/

It will be available in the next release (I'll publish it asap)