algolia / voice-overlay-ios

🗣 An overlay that gets your user’s voice permission and input as text in a customizable UI

Home Page:https://alg.li/voice

Repository from Github https://github.comalgolia/voice-overlay-iosRepository from Github https://github.comalgolia/voice-overlay-ios

AVAudioEngine Exception & Crash App

ShivamKumar-Innthink opened this issue · comments

Hi,
Thank you for your support of this project. Actually i want to say that when open ViewController for speech multi times and speak then "app crash" sometime .

File Name:-
SpeechController.swift

Method Name:-

public func startRecording(textHandler: @escaping SpeechTextHandler, errorHandler: @escaping SpeechErrorHandler) {
requestAuthorization {[unowned self] (authStatus) in
if authStatus {
if !self.audioEngine.isRunning { -->>>>**//Error
self.record(textHandler: textHandler, errorHandler: errorHandler)
}
} else {
let errorMsg = "Speech recognizer needs to be authorized first"
errorHandler(NSError(domain:"com.algolia.speechcontroller", code:1, userInfo:[NSLocalizedDescriptionKey: errorMsg]))
}
}
}

**Error:--
Fatal error: Attempted to read an unowned reference but the object was already deallocated

@ShivamKumar-Innthink were you able to fix this ?