From f7297e18fd77b99157b0dfc4782e8593ac9f4a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Caddet?= Date: Sat, 26 Sep 2020 23:39:30 +0200 Subject: [PATCH] add condition for macOS 11 and greater for default backend --- src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 67dea00..bc29f4b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -230,7 +230,8 @@ impl TTS { let version = version[1]; let version_parts: Vec<&str> = version.split(".").collect(); let minor_version: i8 = version_parts[1].parse().unwrap(); - if minor_version >= 14 { + let major_version: i8 = version_parts[0].parse().unwrap(); + if minor_version >= 14 || major_version >= 11 { TTS::new(Backends::AvFoundation) } else { TTS::new(Backends::AppKit)