algolia / voice-overlay-ios

🗣 An overlay that gets your user’s voice permission and input as text in a customizable UI
https://alg.li/voice
MIT License
545 stars 62 forks source link

AVAudioEngine Exception & Crash App #30

Closed ShivamKumar-Innthink closed 3 years ago

ShivamKumar-Innthink commented 4 years ago

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

ioskunal commented 4 years ago

@ShivamKumar-Innthink were you able to fix this ?