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

Speech and sound improvements #4

Open
DavidKinder opened this issue Jan 21, 2019 · 1 comment
Open

Speech and sound improvements #4

DavidKinder opened this issue Jan 21, 2019 · 1 comment

Comments

@DavidKinder
Copy link
Owner

DavidKinder commented Jan 21, 2019

Suggestions from Nikita Tseykovets:

  • Add a key press to skip the current sentence, and another key to repeat the last sentence. This needs rules to define what constitutes a sentence, but that should be possible.

  • Add hotkeys to turn sound on and off, and to control the sound volume, without affecting speech.

@DavidKinder DavidKinder changed the title Speech improvements Speech and sound improvements Aug 4, 2019
@mcgsegur
Copy link

mcgsegur commented Nov 24, 2023

You can make the TTS more 'dynamic" and "confortable" by stopping any current TTS text being rendered when you send a new one to be spoken (when you type a new request). This way you can avoid listening to the same WHOLE text you already heard before when REENTERING a "room", as a new "command" will "discard the queued sentences being spoken". This is easily done by changing the source code in "FrotzSound.cpp" in two points:

typedef enum SPEAKFLAGS {
  SPF_ASYNC = (1L<<0),
  SPF_PURGEBEFORESPEAK = (1L << 1)
} SPEAKFLAGS;

and

// Speak some text
void TextToSpeech::Speak(LPCWSTR speech)
{
  if (m_voice != NULL)
    m_voice->Speak(speech,SPF_ASYNC | SPF_PURGEBEFORESPEAK,NULL);
}

and just to deal correctly with the loading of a "new adventure", just change FrotzApp.cpp like this:

// Load a new game
void FrotzApp::OnFileNew() 
{
  if (PromptForGame(false))
  {
  // code added
    FrotzSound::ShutDown();
    m_spokenIndex = 0;
  //
    StoreWindowSize();
    m_wantRestart = true;
    theWnd->InputType(FrotzWnd::Input::CheckRestart);
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants