From 569bb160b8702929c8c23a8ff3d985e1ca07e084 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Thu, 31 Mar 2022 14:47:20 -0500 Subject: [PATCH] Try to intercept cases where voice might be nil. --- src/backends/av_foundation.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/backends/av_foundation.rs b/src/backends/av_foundation.rs index 4f87395..cf657e1 100644 --- a/src/backends/av_foundation.rs +++ b/src/backends/av_foundation.rs @@ -42,6 +42,12 @@ impl AvFoundation { utterance: id, ) { trace!("speech_synthesizer_did_start_speech_utterance"); + let vid: id = unsafe { msg_send![utterance, voice] }; + if vid == nil { + println!("nil voice"); + } else { + println!("Got voice ID"); + } unsafe { let backend_id: u64 = *this.get_ivar("backend_id"); let backend_id = BackendId::AvFoundation(backend_id);