1
0
mirror of https://github.com/ndarilek/tts-rs.git synced 2024-11-17 13:09:37 +00:00

add condition for macOS 11 and greater for default backend

This commit is contained in:
François Caddet 2020-09-26 23:39:30 +02:00
parent f78aed211f
commit f7297e18fd

View File

@ -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)