Open rootux opened 1 year ago
Yeah, I remember there were issues regarding iOS settings/sample rate. You can try out some of the older versions, I think the recording API used in the iOS backend changed in-between
There is this comment in the code that may be related - https://github.com/anarchuser/mic_stream/blob/main/ios/Classes/SwiftMicStreamPlugin.swift#L148
// neither does setting AVLinearPCMBitDepthKey on audioOutput.audioSettings (unavailable on iOS)
// 99% sure it's not possible to set streaming sample rate/bitrate
// try AVAudioSession.sharedInstance().setPreferredOutputNumberOfChannels(numChannels)
@anarchuser Not sure what do you mean. Can you please elaborate?
I see some change in the area here - https://github.com/anarchuser/mic_stream/pull/61/files#diff-92b5a8c491b845cd6d9e20f37fe82c7d10f0410693426936cb7515f4dd23007eR118
It will take me some time to look into it. If you want please give it a look yourself. I think it shouldn't be difficult; I just cannot test it myself.
On iOS, setPreferredSampleRate()
is used and there is no guarantee that it will be applied. In fact, it is ignored on most devices and the actual sampling rate is device dependent.
If you require a specific sampling rate for your application, you have to resample the audio.
for the following code -
I get back this -
Hence the library is ignoring the settings. I know @anarchuser you did not write that part :) Trying to figure out a solution