You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func startRecording()async{do{
// this needs to be added
letaudioSession=AVAudioSession.sharedInstance()try audioSession.setCategory(.playAndRecord, mode:.default)try audioSession.setActive(true)tryawait recorder.prepare()tryawait recorder.record()}catch{print(error)}}
So this needs to be set better in the AudioRecorder's record function
@MainActorpublicfunc record()asyncthrows{
// this seems to be set too late
try _AVAudioSession.shared.setCategory(.record, mode:.default)try _AVAudioSession.shared.setActive(true)guardtry base.record()else{
// this error gets thrown on the first attempt to record
throw_PlaceholderError()}self.state =.recording
}
The text was updated successfully, but these errors were encountered:
Just calling the recorder.prepare() function doesn't work on the first try to record, but works on the second attempt:
The following code does work:
So this needs to be set better in the
AudioRecorder
'srecord
functionThe text was updated successfully, but these errors were encountered: