Closed leecbaker closed 1 year ago
Thanks for the report. Going to look into this next week.
If you'd like to help in the meantime, I did a bit of research and it looks like unic_langid uses unicode language identifiers while macOS generates BCP 47 codes. I guess these are mostly compatible, emphasis on mostly. We have 3 paths:
Find a BCP 47 parsing crate, and see if we can use that for the mac backend only.
Find a BCP 47 parser and switch everything to that, begging on BCP 47 as the format everything uses whether intentionally or not.
Ditch the high-level language parsing and just hand back a string.
I'll plan on digging into this more next Monday or Tuesday, but any preliminary research/PRs would be welcome. I found a few potential BCP 47 parsers on crates.rs but didn't do more than search and glance at the results.
Thanks a bunch.
Hmm, maybe this crate, or the one it links to? https://lib.rs/crates/oxilangtag
Actually, just pushed a refactor to use oxilangtag to the oxilangtag branch. All backends except for the macos backends have been ported.
I need to update my mac to macOS 13 and kind of don't want to deal with that this week. If you can port both mac backends to oxilangtag, confirm that examples now work, and submit a PR on that branch, I can push 0.25.0 and hopefully get this fixed. Otherwise I'll do the upgrade on Monday and finish the port then.
Thanks.
There's a default voice on macOS Ventura that causes a crash because its language description has an unsupported subtag. The voice is
Fiona
, with a language ofen-GB-u-sd-gbsct
. This is may be an upstream problem in unic_langid, but I have not confirmed that.Observed behaviour:
thread 'main' panicked at 'called Result::unwrap() on an Err value: ParserError(InvalidSubtag)', src/backends/av_foundation.rs:315:72
How to reproduce:
cargo run --example hello_world
My system:
mac OS 13.0.1 (22A400) rustc 1.65.0 (897e37553 2022-11-02)
Temporary workaround
The unwrap() that crashes can be replaced with this as a temporary workaround to avoid the crash: