90106 Commits

Author SHA1 Message Date
Jaromir Wysoglad
c402666635 TTS: Refactoring
Refactoring as suggested by bluegr on github.
2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
07acdb8433 TESTBED: Don't build TTS tests if TTS is disabled 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
54c37f6f46 TTS: Document diferences in resume()
On linux the resume() behaves slightly differently than on
other platforms.
2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
c861581adc TTS: Fix missing indentation 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
c2c4458253 JANITORIAL: Remove some trailing whitespaces 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
b1bffaba86 TTS: Implement our own queuing on windows.
Similarly as on linux, there isn't enough control of the speech
queue to properly implement INTERRUPT_NO_REPEAT. So since this
commit we use our own queuing and use SAPI to speak each speech.
This is done outside the main thread.
2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
1a6ad384cb TESTBED: Increase pause in TTS pause test 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
be5c865c50 TTS: Add proper speech queuing, update INT_NO_REP.
Before I used SPD to queue messages and I had a copy of the queue,
so I could requeue everything when resume is called(). But more
control of the queue is needed, so I don't use the SPD's queue
and instead start speeches from my queue one by one from another
thread.

INTERRUPT_NO_REPEAT now behaves as described in the documentation
2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
01d843c527 TTS: Update documentation of INTERRUPT_NO_REPEAT 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
f131cad3e5 TESTBED: Improve some TTS tests 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
38e769430a TTS: Improve documentation 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
bc10117980 TTS: Restart SPD if resume() fails. 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
4036b73b6c TTS: Fix INTERRUPT_NO_REPEAT on Windows 2019-09-01 22:47:55 +03:00
Thierry Crozat
13a32fc5e9 TTS: Implement *_NO_REPEAT actions and Fix state synchronization issues on macOS
The NSSpeechSynthesizer is asynchronous and does not immediately start, pause,
or stop the speech. As a result querrying the state of the NSSpeechSynthesizer
does not alwats return the expected result (for example isSpeaking may not
yet been true just after we requested starting to speak). So instead the
TextToSpeechManager on macOS keeps track of the state itself.
2019-09-01 22:47:55 +03:00
Thierry Crozat
bd2757138b TESTBED: Make sure to process events while waiting for speech to finish
Same implementations of TextToSpeechManager may require system events
to be processed for the state synchronisation to work properly.

This commit also fixes a few typos or inconsistencies in some texts.
2019-09-01 22:47:55 +03:00
Thierry Crozat
5198459bba TESTBED: Move the TTS tests after the critical components 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
21fb4cef06 TTS: Implement our own queuing for linux
It seems like, that at least some versions of speech-dispatcher
aren't able to successfuly pause and resume. For me, when trying
to pause, it still finishes the speech just being said instead
of pausing it and then it puts it at the end of the speech queue
with some speech-dispatcher internal commands added to it, which
are also hearable.

There is no way to find out where the speech ended when calling
pause, so it is just stopped and when resume is called it is
read from it's start again.
2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
7613bcaa5f TTS: Use QUEUE_NO_REPEAT action for tooltips 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
84df34df10 TESTBED: Add tests for TTS *_NO_REPEAT actions 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
fb12e3b36b TESTBED: Rewrite parts of TTS tests.
As suggested by Criezy on github
2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
4bae32ffe7 TTS: Add *_NO_REPEAT actions 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
98cea3e2ce TESTBED: Add state queries to TTS tests. 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
feaba6fff6 TTS: Reimplement isSpeaking on Windows. 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
1234f8e42f TTS: Fix pause() and resume() on linux 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
a5c9e8c74b TESTBET: Add TTS tests 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
7ec4f03a08 TTS: Make state switching faster on Linux 2019-09-01 22:47:55 +03:00
Thierry Crozat
9ca2602e82 TTS: Implement speech queueing on macOS 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
1694b930e6 TTS: Make one say() method non-virtual 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
a81b59a3c4 TTS: Don't read tooltips when TTS is speaking 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
6703f88f7f TTS: Implement speech queueing on Linux and Win 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
bbbb608c52 TTS: Implement OSD message reading 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
f89ca9ad5c TTS: Add tooltip reading when they appear. 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
59631627c8 TTS: Fix reading of list widgets
The TTS read items from list widgets even when the mouse was
outside the widget
2019-09-01 22:47:55 +03:00
Thierry Crozat
bac880816b TTS: Stop or pause speaking on word boundaries in macOS implementation 2019-09-01 22:47:55 +03:00
Thierry Crozat
5baa023ed0 TTS: Improve documentation 2019-09-01 22:47:55 +03:00
Thierry Crozat
0434419b31 TTS: Implement TextToSpeechManager for macOS 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
e965df1e88 TTS: Add TTS support when compiling with msvc. 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
990ab61793 MORTEVIELLE: Improve voice mapping to characters.
* Return pitch -= 6 to females, this brings the pitch closer
    to zero
 * Add array of indices which ensures, that we use as many voices
    as we can.
2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
a1f69e6b06 MORTEVIELLE: Refactoring as suggested by Criezy
* Add checks if ttsMan != null before trying to use it
 * Simplify startSpeech
 * Move haut to startSpeech and pass the character index to
    the startSpeech instead.
2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
99550a95b2 MORTEVILLE: Stop speech when pressing F8. 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
c7dbf192ef TTS: Remove unneeded code
Remove debuging outputs
Remove commented iconv implementation of text conversion to UTF-8
2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
1795206289 TTS: Add checks to configure.
Check for presence of required libraries
Disable automatic build of TTS on MinGW32
2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
58065ceacd TTS: Refactoring
* Delete multiple empty rows
 * Make getVolume non-virtual and leave just the implementation
    in base class
 * Resolve warning about signed / unsigned comparison in
    gui-manager
 * Clear availableVoices when updating voices on linux
 * By default set language to transMan language on windows
    (if the transMan is available)
 * Remove freeVoices method from Windows ttsMan, it isn't needed
    anymore
2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
4ec10ffec7 TTS: Remove "static" from initTextToSpeech() 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
2ecbf9ac18 MORTEVIELLE: Return old code to waitSpeech
The waitSpeech should use the old code, when just sound is playing
(the TTS isn't speaking).
2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
c9ec089e61 MORTEVIELLE: Remove unneeded TTS code 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
d2b9b9ef21 MORTEVIELLE: Map characters to different voices 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
0631070833 TTS: Fix state switching on windows
Voice is changed when changing language on windows, so when poping
state, the voice, that should get set has to be saved before
changing the language.

The speech shouldn't continue when changing state, so it is stopped
in pushState and popState.
2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
e4363ba229 TTS: Minor Windows TTS refactoring
Main changes are:
 * Save age information about each voice
 * Remove Sample TTS Voice from available voices, because it
 	basicaly cannot speak.
 * Stop speech after silently playing the test speech (the last
 	voice could be heard speaking after the volume got
	restored to its original value)
 * Remove voice data freeing from freeVoices, because it gets
 	freed automaticaly
2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
e04463b05a MORTEVIELLE: Add text to speech capability 2019-09-01 22:47:55 +03:00