New in version 2.3.
Uses .NET libraries to convert text to speech and optionally play .wav sounds. Audio Service needs to be running and some kind of speakers or headphones need to be attached to the windows target(s) for the speech to be audible.
parameter | required | default | choices | comments |
---|---|---|---|---|
end_sound_path | no | Full path to a .wav file containing a sound to play after the text has been spoken. Useful on conference calls to alert other speakers that ansible has finished speaking. |
||
msg | no | none | The text to be spoken. Use either msg or msg_file. Optional so that you can use this module just to play sounds. |
|
msg_file | no | none | Full path to a windows format text file containing the text to be spokend. Use either msg or msg_file. Optional so that you can use this module just to play sounds. |
|
speech_speed | no | How fast or slow to speak the text. Must be an integer value in the range -10 to 10. -10 is slowest, 10 is fastest. |
||
start_sound_path | no | Full path to a .wav file containing a sound to play before the text is spoken. Useful on conference calls to alert other speakers that ansible has something to say. |
||
voice | no | system default voice | Which voice to use. See notes for how to discover installed voices. If the requested voice is not available the default voice will be used. Example voice names from Windows 10 are 'Microsoft Zira Desktop' and 'Microsoft Hazel Desktop'. |
# Warn of impending deployment - win_say: msg: Warning, deployment commencing in 5 minutes, please log out. # Using a different voice and a start sound - win_say: start_sound_path: 'C:\Windows\Media\ding.wav' msg: Warning, deployment commencing in 5 minutes, please log out. voice: Microsoft Hazel Desktop # example with start and end sound - win_say: start_sound_path: 'C:\Windows\Media\Windows Balloon.wav' msg: "New software installed" end_sound_path: 'C:\Windows\Media\chimes.wav' # text from file example - win_say: start_sound_path: 'C:\Windows\Media\Windows Balloon.wav' msg_text: AppData\Local\Temp\morning_report.txt end_sound_path: 'C:\Windows\Media\chimes.wav'
Common return values are documented here Common Return Values, the following are the fields unique to this module:
name | description | returned | type | sample |
---|---|---|---|---|
message_text | the text that the module attempted to speak | success | string | Warning, deployment commencing in 5 minutes. |
voice | the voice used to speak the text. | success | string | Microsoft Hazel Desktop |
voice_info | the voice used to speak the text. | when requested voice could not be loaded | string | Could not load voice TestVoice, using system default voice |
Note
Needs speakers or headphones to do anything useful.
Note
To find which voices are installed, run the following powershell Add-Type -AssemblyName System.Speech $speech = New-Object -TypeName System.Speech.Synthesis.SpeechSynthesizer $speech.GetInstalledVoices() | ForEach-Object { $_.VoiceInfo } $speech.Dispose()
Note
Speech can be surprisingly slow, so its best to keep message text short.
For more information on what this means please read Extras Modules
For help in developing on modules, should you be so inclined, please read Community Information & Contributing, developing_test_pr and Developing Modules.
© 2012–2016 Michael DeHaan
© 2016 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/win_say_module.html