Plugin=Speech
The number value of the measure will be the total number of voices installed on your system.
The string value of the measure will be the currently selected voice name.
Most simple working example:
Code: Select all
[Rainmeter]
Update=1000
[SpeechHost]
Measure=Plugin
Plugin=Speech
[MeterSpeak]
Meter=Image
W=50
H=50
SolidColor=255,255,255,255
LeftMouseUpAction=[!CommandMeasure SpeechHost "Hello World!"]
Options
Name
Name of the desired Text-to-Speech voice to use.
This can be any installed voice on your system.
You can find out what Name(s) are supported on your system by opening a Powershell.exe window and pasting in the following:
Code: Select all
Add-Type -AssemblyName System.Speech
$speak = New-Object System.Speech.Synthesis.SpeechSynthesizer
$speak.GetInstalledVoices() |
Select-Object -ExpandProperty VoiceInfo |
Select-Object -Property Culture, Name, Gender, Age
You can also set Debug=1 on the measure to output information about the voices on your system to the Rainmeter Log.
Copy and paste the "Name" entry as the Name option in the plugin measure.
Example:
Name=Microsoft David Desktop
Notes:
If an invalid Name is used, the plugin will default to the first supported voice installed on your system that best matches other options.
By default, Windows will come with the following voices installed:
Windows 10
Microsoft David Desktop - Male - en-US
Microsoft Zira Desktop - Female - en-US
Windows 7
Microsoft Anna - Female - en-US
Additional voices can be obtained by installing Language Packs in Windows 10:
https://www.thewindowsclub.com/install-uninstall-languages-windows-10
While not for the faint of heart, other voices that may already be lurking on your system can be unlocked for use with this plugin:
https://winaero.com/blog/unlock-extra-voices-windows-10/
Gender
Gender of the desired Text-to-Speech voice to use.
This can be one of Male or Female.
Example:
Gender=Male
Notes:
This is ignored if a valid Name option is used.
If a valid Gender is defined, but no voice of that gender exists on the system, the first installed voice will be used.
Index
Alone, this is the number of the voice in the list of voices supported on your system.
Combined with Gender, this is the number of the voice of that gender in the list of voices supported on your system.
Examples:
Index=3
The third voice on your system.
Gender=Male
Index=2
The second male voice on your system.
Note: This is ignored if a valid Name option is used.
Volume
Volume level for the speech.
This is an integer value from 0 to 100 as a percentage.
The default is 100
Example:
Volume=60
Rate
The rate of speed at which the text will be spoken.
This is an integer value from -10 (slow) to 10 (fast).
The default is 0
Example:
Rate=-1
Debug
If set to 1, when the measure is refreshed, it will output information about the supported voices on your system to the Rainmeter Log.
The default is 0
Example:
Debug=1
Plugin Commands
!CommandMeasure
The plugin does nothing as a part of the normal update of the skin or measure. It is activated to speak by using !CommandMeasure with a string of text as the only parameter.
Examples:
LeftMouseUpAction=[!CommandMeasure MeasureName "Hello World"]
OnChangeAction=[!CommandMeasure MeasureName "You've got mail!"]
IfTrueAction=[!CommandMeasure MeasureName "The value is [SomeOtherMeasure]"]
Note: Any currently speaking text can be stopped by passing an empty string to the measure:
LeftMouseUpAction=[!CommandMeasure MeasureName ""]
Refreshing the skin will also stop any currently speaking text.
Final Note
Given that there is no way to know what voices any given user might or might not have installed on their system, the safest way to distribute a skin that uses this plugin is to only set Index=1, or if you prefer, Gender=Female and Index=1 on the measure. Those are certain to work on all systems. Then just provide instructions to your users to try different Index and/or gender values until they find a supported voice they prefer. All Windows systems are certain to have at least one female voice installed.
Download
Download the .rmskin to get the plugin installed on your system. The 64bit and 32bit .dll files will also be placed in your @Vault folder for use in your skins:
The 32bit and 64bit Speech.dll files can be downloaded without any .rmskin:
The source code for the plugin is available at:
https://github.com/jsmorley/PluginSpeech
This requires the use of the Rainmeter Plugin SDK to build.