Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TTS: Text to speech support #1808

merged 95 commits into from Sep 1, 2019
Commits on Aug 26, 2019
  1. TTS: Create a TTS skeleton

    vyzigold committed Jul 10, 2019
  2. TTS: Add part of linux TTS

    vyzigold committed Jul 10, 2019
  3. TTS: Add TTS checkbox to Options

    vyzigold committed Jul 12, 2019
    Probably works only in the builtin theme right now.
  4. TTS: Restrict TTS on linux to only english

    vyzigold committed Jul 14, 2019
    Unfortunatedly the encoding used by ScummVM breaks the
    speech-dispatcher, so after trying to say non-ascii character
    the connection has to be restarted. So for now I am restricting
    the GUI TTS to english only.
  5. TTS: Convert strings to UTF-8

    vyzigold committed Jul 14, 2019
    Conversion happens only for languages, that might needed (not
    for english)
  6. TTS: Prepare for windows TTS

    vyzigold committed Jul 16, 2019
    Add windows configuration in configure
    Add basic skeleton to backends
    Check if ttsMan is initialized in GUI
  7. TTS: Add age to TTSVoice

    vyzigold committed Jul 17, 2019
  8. TTS: Add reference counting to TTSVoice

    vyzigold committed Jul 18, 2019
    Also refactor TTSVoice destruction to use this reference counting.
  9. TTS: Fix voice setting on startup

    vyzigold committed Jul 18, 2019
    The ScummVM was crashing because of an assert, when there was less
    voices availaible, than what was set in the ConfMan.
    Now the voice just falls back to 0th voice, if there are not
    enough voices.
  10. TTS: Add check to getVoice, fix typo.

    vyzigold committed Jul 18, 2019
    Check if _availableVoices isn't empty.
    Replace availaible with available
  11. TTS: Minor refactorisations

    vyzigold committed Jul 19, 2019
     - Add comment to tts initialization on Windows
     - Correctly free the voicesInfo in linux ttsMan
     - Remove popState method from linux-text-to-speech.h and
     - Add tts to help in configure
     - Refactor language setting in gui-manager.cpp
    	It counted with english being the default language in
    	ttsMan constructors, which isn't true anymore.
  12. TTS: Add iconv implementation of strToUtf8

    vyzigold committed Jul 22, 2019
    This might be useful in the future, because SDL cannot convert
    from some important encodings (for example CP850)
  13. TTS: Add getVoiceIndicesByGender to the base class

    vyzigold committed Jul 22, 2019
    This is a way to easily get a list of voices with the given gender
  14. TTS: Implement tts state switching when needed.

    vyzigold committed Jul 22, 2019
    The state has to be pushed and poped when there is a transition
    between game and gui code.
  15. TTS: Minor Windows TTS refactoring

    vyzigold committed Jul 22, 2019
    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
  16. TTS: Fix state switching on windows

    vyzigold committed Jul 23, 2019
    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.
  17. MORTEVIELLE: Return old code to waitSpeech

    vyzigold committed Jul 23, 2019
    The waitSpeech should use the old code, when just sound is playing
    (the TTS isn't speaking).
  18. TTS: Refactoring

    vyzigold committed Jul 23, 2019
     * Delete multiple empty rows
     * Make getVolume non-virtual and leave just the implementation
        in base class
     * Resolve warning about signed / unsigned comparison in
     * 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
  19. TTS: Add checks to configure.

    vyzigold committed Jul 24, 2019
    Check for presence of required libraries
    Disable automatic build of TTS on MinGW32
  20. TTS: Remove unneeded code

    vyzigold committed Jul 24, 2019
    Remove debuging outputs
    Remove commented iconv implementation of text conversion to UTF-8
  21. MORTEVIELLE: Refactoring as suggested by Criezy

    vyzigold committed Jul 24, 2019
     * 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.
  22. MORTEVIELLE: Improve voice mapping to characters.

    vyzigold committed Jul 25, 2019
     * 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.
  23. TTS: Improve documentation

    criezy authored and vyzigold committed Jul 28, 2019
  24. TTS: Fix reading of list widgets

    vyzigold committed Jul 29, 2019
    The TTS read items from list widgets even when the mouse was
    outside the widget
  25. TTS: Implement speech queueing on macOS

    criezy authored and vyzigold committed Jul 31, 2019
  26. TESTBET: Add TTS tests

    vyzigold committed Aug 1, 2019
  27. TESTBED: Rewrite parts of TTS tests.

    vyzigold committed Aug 2, 2019
    As suggested by Criezy on github
  28. TTS: Implement our own queuing for linux

    vyzigold committed Aug 2, 2019
    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.
  29. TESTBED: Make sure to process events while waiting for speech to finish

    criezy authored and vyzigold committed Aug 2, 2019
    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.
  30. TTS: Implement *_NO_REPEAT actions and Fix state synchronization issu…

    criezy authored and vyzigold committed Aug 2, 2019
    …es 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.
  31. TTS: Improve documentation

    vyzigold committed Aug 4, 2019
  32. TTS: Add proper speech queuing, update INT_NO_REP.

    vyzigold committed Aug 8, 2019
    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
    INTERRUPT_NO_REPEAT now behaves as described in the documentation
  33. TTS: Fix missing indentation

    vyzigold committed Aug 12, 2019
  34. TTS: Document diferences in resume()

    vyzigold committed Aug 12, 2019
    On linux the resume() behaves slightly differently than on
    other platforms.
  35. TTS: Implement our own queuing on windows.

    vyzigold committed Aug 13, 2019
    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.
  36. TTS: Refactoring

    vyzigold committed Aug 15, 2019
    Refactoring as suggested by bluegr on github.
  37. TTS: Remove USE_PLATFORM_TTS defines

    vyzigold committed Aug 15, 2019
    Use defined(USE_TTS) && defined(PLATFORM) instead
  38. TTS: Rename LinuxTextToSpeechManager to SpeechDispatcherManager

    vyzigold committed Aug 15, 2019
    Add a new define for the SpeechDispatcherManager
  39. TESTBED: Fix include guard in speech.h

    vyzigold committed Aug 19, 2019
Commits on Aug 27, 2019
  1. COMMON: Add CP850 conversion.

    vyzigold committed Aug 26, 2019
    CP850 is used by the mortevielle engine (and apparently by other
    engines too). Anytime an engine using CP850 encoding wants to use
    the TTS, the encoding has to be converted, so this is pretty
    important encoding conversion to support. Unfortunately SDL
    (when compiled without iconv) doesn't support this encoding
    (which means, there might not be a way to convert this encoding
    on some platforms), so I added a conversion table for this.
Commits on Aug 28, 2019
  1. COMMON: Add CP437 encoding conversion table.

    vyzigold committed Aug 28, 2019
You can’t perform that action at this time.