SpokenWord: A Text-To-Speech Plugin

aporokizzu

anti-kumbaya
Veteran
Joined
Jan 14, 2020
Messages
59
Reaction score
89
First Language
english
Primarily Uses
RMMV
SpokenWord: A Text-To-Speech Plugin v1.0
by dismal_science__

Features
SpokenWord is a plugin for RPG Maker MV that allows you to easily include text-to-speech in your projects using plugin commands, script, and/or message control characters.

Screenshots
quick_st.PNG
ss_t2.PNG

How To Use
Once the plugin has been successfully added to your project, the easiest way to use SpokenWord text-to-speech in your game is by using control characters in a Show Text event command.

To do this, create a new event or edit an existing event:



The Edit command should bring up that event's Editor window:



In the contents section, right-click and select New:



Now, in the Event Commands window, click on the 1 tab and choose Show Text under the Message section:



This will bring up the Show Text window, where you can specify what text should appear in the message window when your player character interacts with this event.



RPG Maker MV uses control characters as a way to "display values of variables and names of actors by entering [them] into the text":



SpokenWord adds three additional control characters, which can be used in addition to the ones listed above:



So, let's try it out- in the Text section of the window type in the following:

Code:
\SW[Hello], can you hear me?
Now click OK to return to the Event Editor, and make sure Priority is set to "Same as characters" and Trigger is set to "Action Button" before hitting OK again and returning to the Map Editor.



Now we're ready to go! Click on the Playtest button and test it out:




That is the simplest way to implement SpokenWord in your project. For more flexibility, the plugin also offers more advanced commands.



ADVANCED COMMANDS
In the most basic example, we only used the \SW[x] control character. But what about the other two?

\SWE['x'] allows you to evaluate (execute JavaScript) x as code and display the result. So if your text was:

Code:
\SW[Hello], \SWE['$gameActors.actor(1)._name'] can you hear me?
The message box should display something like:



And you should hear "Hello" and "Harold".

* Please note that the code / expression you wish to evaluate must be wrapped in 'single quotes' for it to work.

Similarly, \SWV[x] lets you display and utter the value of the xth variable. In this example $gameVariable 5 is equal to 3, so:

Code:
\SW[Hello], \SWE['$gameActors.actor(1)._name'] can you hear me?

\C[1]You owe me \SWV[5] cookies!
Should display:



And you should hear "Hello", "Harold" and "3".

Beyond control characters, SpokenWord can also be invoked using plugin commands.

Code:
spokenWord word

spokenWord #VariableID

spokenWord e:JavaScriptCode
Similar to control characters this will utter either a specified word, variable ID or expression.

Examples include-

Code:
spokenWord dope
You should hear "dope".

Code:
spokenWord #5
If $gameVariable 5's value is 3, you should hear "3".

Code:
spokenWord e:$gameActors.actor(1)._name
You should hear "Harold".

The second plugin command is setVoice-

Code:
setVoice vValue pValue rValue
This changes the settings (see plugin parameters in the Setup section) of volume (v), pitch (p), and speech rate (r).

So-

Code:
setVoice p2 r3
Would set the pitch to 2 and speech rate to 3.

Code:
setVoice v0.5 p0.7
Would set volume to 0.5 and pitch to 0.7.

Finally, SpokenWord has two script commands-

Code:
dismal.SpokenWord.utter("word")
Again, like the \SW[x] control character and the spokenWord plugin command, this will utter the specified word.

And lastly,

Code:
dismal.SpokenWord.setVoice(volume, pitch, rate)
This script function is similar to the setVoice plugin command.


Script
Download here (itch.io)

Terms of Use
This plugin is released under a modified X11 license.

Copyright ©MMXX dismal_science__. All Rights Reserved.
Permission to use and distribute for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both copyright notice and this permission notice appear in supporting documentation.

Additional Terms of Use
  1. "dismal_science" must be given credit in your games.
  2. Do NOT change the code, filename, parameters, and information of the plugin.
  3. Do NOT take code for your own released plugins.
The above copyright notice, additional terms of use, and this permission notice shall be included in all copies or substantial portions of the plugin.

THE PLUGIN IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE PLUGIN OR THE USE OR OTHER DEALINGS IN THE PLUGIN.



CHANGELOG
2020.05.29 Initial Release.

Enjoy!
 
Last edited:
Joined
Jul 25, 2019
Messages
30
Reaction score
2
First Language
English
Primarily Uses
RMMV
Thank you so much, i was looking for something like this! do you plan to include other text to speech voices in the future?
 

aporokizzu

anti-kumbaya
Veteran
Joined
Jan 14, 2020
Messages
59
Reaction score
89
First Language
english
Primarily Uses
RMMV
Thank you so much, i was looking for something like this! do you plan to include other text to speech voices in the future?
Hi, @Personthatsonthisnow - thanks for your interest in my plugin.

SpokenWord utilizes JavaScript's built-in Web Speech API to perform its text-to-speech conversions, so the number of voices available really depends on the Operating System that the project using the plugin is running on and varies from system to system.

For example, my Windows PC only has 1 voice available ("Anna"):
debug_speechsynthesis.PNG

Meanwhile, my Mac OSX system has 65 voices (below are the first 37):
debug_speechsynthesis_osx.png

Because of this variation, I decided to keep it simple while writing the plugin and only use the default voice (which as you might notice, also differs depending on your OS- on my Windows it is "Anna", on the Mac it is "Fiona") since it would also follow that the voices available on the machine you are creating your project on would not necessarily be the same as the ones available on the end user's device.

Should things change, I might update the plugin's code to allow for more customization but for now, for the sake of compatibility, the speech will be limited to your system's default voice.
 
Joined
Jul 25, 2019
Messages
30
Reaction score
2
First Language
English
Primarily Uses
RMMV
alright, that seems fair! Thank you for answering, this plugin has been very useful to me so far, and the art for the preview video is fantastic!
 

aporokizzu

anti-kumbaya
Veteran
Joined
Jan 14, 2020
Messages
59
Reaction score
89
First Language
english
Primarily Uses
RMMV
alright, that seems fair! Thank you for answering, this plugin has been very useful to me so far, and the art for the preview video is fantastic!
@Personthatsonthisnow thank you- I'm going for that crunchy, Super Famicom aesthetic... but it's very time consuming to create; so I hop between writing code for my project and pixel art. I'm glad that other people appreciate it too!

Also, good to hear that you are finding the plugin useful in your project- please share when it is ready, I'd be interested to see it.
 

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
152
Reaction score
12
First Language
Spanish
Primarily Uses
RMMV
I wish you could change the default Windows voice to something else.
 

fizzly

Veteran
Veteran
Joined
Mar 23, 2012
Messages
742
Reaction score
470
First Language
Polish
Primarily Uses
RMMV
It sounds incredible.....just woah!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

People3_3 and People3_4 added!

does there exist a word for a state of being that is between "living" and (not "dead", but ...) "not living" .... does that make sense, or do I just sound like Im high for something :[ ?
Hope you are all fine today~
Moderators, you must have so much patience to be able to deal with everything. I mod in a server of sorts and today we just got a message, which, despite it's helpful constructive criticism, basically stated that all of the mods were jerks and that was the only reason our server was unlikeable. So, thank you, for having patience. You are appreciated! :kaoluv:

Forum statistics

Threads
105,744
Messages
1,016,064
Members
137,427
Latest member
olixproductions
Top