Dre4m Shell
Server IP : 85.214.239.14  /  Your IP : 3.146.178.241
Web Server : Apache/2.4.62 (Debian)
System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.18
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/ansible_collections/community/windows/plugins/modules/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /lib/python3/dist-packages/ansible_collections/community/windows/plugins/modules/win_say.py
#!/usr/bin/python
# -*- coding: utf-8 -*-

# Copyright: (c) 2016, Jon Hawkesworth (@jhawkesworth) <jhawkesworth@protonmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

DOCUMENTATION = r'''
---
module: win_say
short_description: Text to speech module for Windows to speak messages and optionally play sounds
description:
    - 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.
options:
  msg:
    description:
      - The text to be spoken.
      - Use either C(msg) or C(msg_file).
      - Optional so that you can use this module just to play sounds.
    type: str
  msg_file:
    description:
      - Full path to a windows format text file containing the text to be spoken.
      - Use either C(msg) or C(msg_file).
      - Optional so that you can use this module just to play sounds.
    type: path
  voice:
    description:
      - 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 C(Microsoft Zira Desktop) and C(Microsoft Hazel Desktop).
    type: str
  speech_speed:
    description:
      - 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.
    type: int
    default: 0
  start_sound_path:
    description:
      - Full path to a C(.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.
    type: path
  end_sound_path:
    description:
      - Full path to a C(.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.
    type: path
notes:
   - Needs speakers or headphones to do anything useful.
   - |
     To find which voices are installed, run the following Powershell commands.

                 Add-Type -AssemblyName System.Speech
                 $speech = New-Object -TypeName System.Speech.Synthesis.SpeechSynthesizer
                 $speech.GetInstalledVoices() | ForEach-Object { $_.VoiceInfo }
                 $speech.Dispose()

   - Speech can be surprisingly slow, so it's best to keep message text short.
seealso:
- module: community.windows.win_msg
- module: community.windows.win_toast
author:
- Jon Hawkesworth (@jhawkesworth)
'''

EXAMPLES = r'''
- name: Warn of impending deployment
  community.windows.win_say:
    msg: Warning, deployment commencing in 5 minutes, please log out.

- name: Using a different voice and a start sound
  community.windows.win_say:
    start_sound_path: C:\Windows\Media\ding.wav
    msg: Warning, deployment commencing in 5 minutes, please log out.
    voice: Microsoft Hazel Desktop

- name: With start and end sound
  community.windows.win_say:
    start_sound_path: C:\Windows\Media\Windows Balloon.wav
    msg: New software installed
    end_sound_path: C:\Windows\Media\chimes.wav

- name: Text from file example
  community.windows.win_say:
    start_sound_path: C:\Windows\Media\Windows Balloon.wav
    msg_file: AppData\Local\Temp\morning_report.txt
    end_sound_path: C:\Windows\Media\chimes.wav
'''

RETURN = r'''
message_text:
    description: The text that the module attempted to speak.
    returned: success
    type: str
    sample: "Warning, deployment commencing in 5 minutes."
voice:
    description: The voice used to speak the text.
    returned: success
    type: str
    sample: Microsoft Hazel Desktop
voice_info:
    description: The voice used to speak the text.
    returned: when requested voice could not be loaded
    type: str
    sample: Could not load voice TestVoice, using system default voice
'''

Anon7 - 2022
AnonSec Team