* Initialized TTS `MediaPlayer` in real-time mode.
* Set media category to speech.
* More aggressively drop locks to prevent deadlocks.
* Remove checks of queued items that are no longer necessary.
* Made `is_speaking` check both media player state and queued item count.
* Return eagerly from `stop` if speech isn't in progress, thus eliminating more locks.
We have an ilegal hardware instruction in
backend::av_foundation::voices::AVSpeechSynthesisVoice::new(identifier)
when sending voiceWithIdentifier. Is it because the runLoop is not
runing when it's called?
Tolk seems to fail on strings larger than 325 characters in length. Here we:
* Send any strings with 300 or fewer characters through directly.
* For larger strings, split on whitespace boundaries, then create and send buffers of 300 or fewer characters.
This may not handle internationalized text, and may not handle someone bombarding TTS with a giant word. PRs for either welcome.
Unfortunately, there seems to be a difference in how the `hello_world` example processes rate and volume changes. I'm not sure if it doesn't adjust rate for samples while speaking. In any case, arguably there are just going to be differences in platforms that I can't account for, so this may just have to be. Hopefully it doesn't interfere with actual usage.
* Fix broken delegate method signature.
* Add `NSRunLoop` into `hello_world` example so delegates are called. Presumably, MacOS apps already run one of these, but the example didn't.
* Add necessary dependencies, build script, and `NSSpeechSynthesizer` backend.
* Get very basic speech working.
Needs a delegate to handle queued speech, and currently segfaults if one is set.
`MediaPlayer` only seems to have states for playing and paused, but not stopped. Further, playing when the queue is finished seems to restart playback from the beginning.
Here we clear the list of items to play if the player is paused and we're on the last item. We assume we're done with all items to speak, and clear the list before appending a new item and beginning playback again.
The correct solution is probably to investigate how events work in winrt-rs, but callbacks and Rust have always been a disaster when I've tried them, so I'm hesitant. This does seem to handle the basic scenarios I've thrown at it.
* Move autogenerated code to subcrate to speed up compilation.
* `is_speaking` also checks whether a source is opening, in addition to whether it is playing.
* Return to using autoplay.
Two Tolk instances were being created. One checked for the presence of a screen reader. The other actually performed the speech, and was returned as part of the `TTS` instance.
Unfortunately, Tolk doesn't seem to appreciate being called twice. So here we check if a screen reader is detected and, if one is, return the instance that did the detection. Otherwise, error out and return the WinRT backend.
I'd previously attempted to normalize everything to `u8`, but this had some drawbacks:
* It failed to account for some synthesis drivers defining normal as mid-range, while most define it very low.
* It didn't track the normal value for a given synthesizer.
* There was no clean way to map a curve between the minimum, normal, and maximum rates.
Here we track the minimum, normal, and maximum values of rate, pitch, and volume. Sanity checks are done on set.
Also, as a further proof-of-concept, all properties are now implemented for the WinRT driver.