Bug: can't play the audio after recording is completed and before sent it.
I listen AVPlayerItemFailedToPlayToEndTime event,got "Playback failed with error: The operation could not be completed",i check the audio url / duration / sample, it's all right. What could be the reason for not being able to play?
Have a nice day!
Hey @gzlboy, works ok for me. Does it work if you launch example chat app?
In your example, test with 2 consecutive records and play them, the play error will appear when playing an unfinished record, choose to play another record. @f3dm76
@f3dm76 It is not working in the sample app for me. I record and play and time is always 0 for me.
@f3dm76 It is not working in the sample app for me. I record and play and time is always 0 for me.
brother did you find any solution ?
EDIT 2: Use these settings
.setRecorderSettings(
RecorderSettings(
sampleRate: 12000,
numberOfChannels: 1,
encoderBitRateKey: 0
)
)
EDIT 1: A potential workaround is to use simpler settings
// let settings = [
// AVFormatIDKey: Int(kAudioFormatMPEG4AAC),
// AVSampleRateKey: 12000,
// AVNumberOfChannelsKey: 1,
// AVEncoderAudioQualityKey: AVAudioQuality.high.rawValue
// ]
//
This is a screenshot of me directly updating the code in the sample project (and records sucessfully)
P.S. - The bug happens on iOS 16 and for some reason the simulator which is iOS 18(?)
I'm also seeing this on-device with ios18
the counter never goes up when I tap the microphone, it's always zero long