1
0
mirror of https://github.com/ndarilek/tts-rs.git synced 2024-07-03 12:19:37 +00:00
Commit Graph

57 Commits

Author SHA1 Message Date
22ae0ef5a3 Refactor to oxilangtag for language codes, and bump Windows dependency. 2022-11-21 12:00:35 -06:00
7cf80fb64d WinRT: Correctly set voice for case where no utterances are in queue.
Fixes #29
2022-07-22 10:08:13 -05:00
748f07138d Bump version and dependency. 2022-07-21 18:34:22 -05:00
822f770ab8 Finish making gender optional. 2022-03-31 13:25:08 -05:00
b9aa36cb3b Update APIs to support case where getting a voice is supported but the value isn't set. 2022-03-31 10:43:07 -05:00
b1f60811bf Add voice support to WinRT backend. 2022-03-30 20:13:27 -05:00
c222c087b2 cargo fmt 2022-03-30 10:18:22 -05:00
francois-caddet
88f4598ec6 Merge branch 'master' into feature/voices 2022-03-20 13:02:37 +01:00
2ea472e196 Bump Windows dependency, crate version, and remove Debug derive. 2021-12-28 10:09:54 -06:00
119678ae55 Update to windows 0.27 and bump version. 2021-11-16 11:13:31 -06:00
92538fbdb8 Upgrade windows-rs to 0.23. 2021-11-01 10:36:15 -05:00
c21d4a6a38 Eliminate separate winrt_bindings crate since it no longer seems necessary for fast builds. 2021-03-11 13:21:41 -06:00
42879dfa1f Refactor to new windows crate. 2021-01-22 11:28:42 -06:00
d8f2b3fb00 I'll do my own queuing, MediaPlaybackList is either the wrong tool for the job or way too buggy. 2020-12-07 21:35:07 -06:00
a905439d9c Add strategic backoff in WinRT backend to (hopefully) eliminate a deadlock. 2020-12-07 14:58:59 -06:00
f4952ad132 UWP tweaks and optimizations.
* 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.
2020-11-25 10:07:28 -06:00
669c94af36 We don't need autoplay. 2020-11-23 17:20:55 -06:00
d97796fff7 Eliminate a Clippy warning. 2020-11-17 16:03:03 -06:00
590d6369fb Remove debugging printlns. 2020-11-17 10:25:21 -06:00
6a706f36ab Fix double-speaking bug for good, hopefully. 2020-11-11 10:27:03 -06:00
031e0ff23f Fix more queuing issues under WinRT. 2020-11-03 12:02:16 -06:00
6b74afe503 Remove unused variable. 2020-11-03 11:24:09 -06:00
289a35dc83 Don't double-speak previous item when not flushing queue. 2020-11-03 11:20:02 -06:00
9c98026978 Don't re-initialize a player, just clear the item list. 2020-11-03 11:11:49 -06:00
d3e05b5a7a Revert "Pass TTS instance as first argument to utterance callbacks."
This appears to break callbacks, and is of limited utility.

This reverts commit 29c0a8463e.
2020-11-03 11:03:55 -06:00
29c0a8463e Pass TTS instance as first argument to utterance callbacks. 2020-11-02 22:40:30 -06:00
cf0ad2221e Derive Debug. 2020-11-02 21:44:47 -06:00
551bb1292e Make TTS clonable.
Also, add other possibly useful derives.
2020-11-02 21:27:13 -06:00
565aa6d654 Fix issue where is_speaking always returns true under WinRT, and bump version. 2020-11-02 13:30:39 -06:00
5feede0b8f Remove unnecessary debug logs. 2020-11-02 10:11:53 -06:00
0bbda0a90f Remove WinRT code for handling paused player state, which caused issues with queued speech. 2020-10-30 10:23:24 -05:00
88ec7db075 Eliminate accidental deadlock. 2020-10-08 09:44:46 -05:00
8c783205c3 Implement utterance_stop callback on most platforms. 2020-10-08 07:56:45 -05:00
174011bbb4 Make UtteranceId use u64 on most platforms, and add additional derives. 2020-10-08 07:16:10 -05:00
Francois Caddet
8c8dc0ae9f add voices value returned by the backends 2020-09-26 23:03:56 +02:00
dbac8a3fe0 Eliminate some Clippy warnings. 2020-09-26 12:43:16 -05:00
Francois Caddet
47cbb80595 Merge branch 'develop' into feature/voices 2020-09-26 18:20:10 +02:00
1f22843086 Refactor Linux, Windows, and Wasm platforms to use FnMut for callbacks, and bump version. 2020-09-25 11:08:19 -05:00
96e5d21e24 Implement callbacks for WinRT. 2020-09-24 17:56:46 -05:00
6788277a4d Implement framework for utterance callbacks in Windows backends, though they aren't currently called. 2020-09-23 10:31:21 -05:00
f5f11b7cdf Switch to using MediaPlaybackItem as WinRT utterance ID. 2020-09-22 14:51:59 -05:00
4816ec575c Make speak calls return an utterance ID, where possible. 2020-09-22 12:40:03 -05:00
François Caddet
335ac710a6 add unimplemented functions forvoices feature on every backends 2020-09-05 12:07:51 +02:00
e1bb6741a9 Correctly indicate that WinRT supports detection of speaking. 2020-07-07 09:08:44 -05:00
16a6f6378a Under WinRT, recreate player completely when interruption is requested. 2020-07-06 12:52:18 -05:00
1d7c668a4a Sanity-check value to prevent overflow. 2020-07-06 12:14:50 -05:00
d830f44c55 Handle corner case where WinRT speech that doesn't interrupt, and is played after a delay, causes recently-spoken utterances to replay.
`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.
2020-06-17 18:54:34 -05:00
ce8c5f5289 Refactor to use separate tts_winrt_bindings crate, and bump version. 2020-06-17 17:25:43 -05:00
45c7b1afc7 Various WinRT refinements.
* 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.
2020-06-17 16:46:42 -05:00
10a9d56ae5 Remove autoplay setting. 2020-06-14 20:03:11 -05:00