Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

text to speech

edited May 2015 in Help! with 2.0
I have 3 characters in my story. Is there a way to hear the dialog as well as read it?

Comments

  • When asking a question, please state which story format you're using. Sugarcane is the default for Twine 1 and Harlowe is the default for Twine 2. Since you posted this in Chit-Chat, we don't know if this is for Twine 1 or Twine 2, either, so please state that as well. :-)
  • Sorry about that. I am using Twine 2. Thanks for letting me know that it also goes by Harlowe.
  • A story created with Twine is basically just a web-page with a built-in Javascript engine, this type of web-page is generally know as a web-app.

    There are three basic ways to do Text to Speech in relation to a web-page:

    1. Use an Accessibility Text to Speech Reader/Tool that supports web-browsers:

    There are issues using a tool like this with Twine a story because each passage the player sees is dynamically generated. This is a common problem with web-apps and this article talks about the problems and ways to solve them.

    2. Use a third-party Javascript library:

    There are libraries like meSpeak.js, google-tts, or ResponsiveVoice JS which allow you to add Text to Speech to a web-app. One potentially good reason for using a library is that some of them support older browsers.

    3. Use the HTML5 Web Speech API:

    This is a relative new feature of HTML5 and is not supported by all browsers, this 2014 article gives an overview of the features of this API
  • Thank you very much. This is very helpful.
  • Hey, no problem. :-)

    Unfortunately, since this is Twine 2, and I'm a Twine 1 guy, I can't help much. However, I'm going to guess that there will be suggestions that you use SugarCube since your work includes sound.

    Twine has "story formats." Story formats control both the basic appearance and behavior of Twine and has a great deal to do with the syntax of code written to create works in Twine. Harlowe is just the default story format, there are others, including SugarCube.

    SugarCube has macros for audio.

    So, there are some links for you to research as you seek your answer.

    Here's another big one: http://twinery.org/wiki/twine2:guide

    There are a number of different ways to accomplish your goal. The way I would do it, and it's probably the simplest way, is to have an audio recording play whenever the text appears. Again, I can't give you specifics (i.e., code) since I'm super rusty at using Twine and since this is Twine 2. Hope you find your answer, though! :-)
  • Thank you Sharpe. I appreciate your assistance.
Sign In or Register to comment.