Package: voice-robotifier
Voice RobotifierThis module contains an extremely simple class for recording audio, then playing it back using the text-to-speech program DECtalk.SetupInstallation is made easy using pip:pip install voice-robotifierExampleimportvoice_robotifiervr=voice_robotifier.VoiceRobotifier()vr.set_voice_name('Harry')vr.set_voice_rate(250)# words per minute# optional: use different input/output devices than your current default# vr.set_input_device('Microphone (C-Media USB Audio Device)')# vr.set_output_device('CABLE Input (VB-Audio Virtual Cable)')push_to_talk_key='v'vr.start(push_to_talk_key)ReferenceVoiceRobotifier() -> VoiceRobotifierCreates a newVoiceRobotifierinstance.VoiceRobotifier.start(key: Union[int, str], key_quit: Union[int, str] = 'esc', block: bool = True) -> Callable[None, None]Starts theVoiceRobotifierin push-to-talk mode, wherekeyis an int or str representing the desired push-to-talk key, andkey_quitrepresents the key that should cause the thread to stop.The operations of the method take place in a daemon thread, which the current thread will join on ifblockisTrue. If you want to carry out other program operations while it runs, setblocktoFalse.Returns a function that stops the daemon thread when called. (This is really only useful whenblockisFalse, since otherwise the function will never return anything until an exception occurs.)VoiceRobotifier.start_autodetect(energy_threshold: Union[float, None] = None, key_quit: Union[int, str] = 'esc', block: bool = True) -> Callable[None, None]Starts theVoiceRobotifierin autodetect mode -- it will wait for the audio input to have a greater energy level thanenergy_thresholdbefore processing it. This value should generally be from 150 to 3500 in most cases. Ifenergy_thresholdisNone, the input device's current energy level will be sampled to auto-determine an energy level.Thekey_quitandblockarguments as well as the returned function act the same as those inVoiceRobotifier.start.VoiceRobotifier.set_voice_name(voice_name: str) -> NoneSets the voice that should be used for generating text-to-speech audio.voice_nameshould be a name from the list returned byVoiceRobotifier.list_voices.VoiceRobotifier.set_voice_rate(voice_rate: int) -> NoneSets the speed of the voice used for text-to-speech in words per minute. 200 is the default.VoiceRobotifier.list_voice_names() -> List[str]Returns a list of the names of all text-to-speech voices available through DECtalk. They can be passed as arguments toVoiceRobotifier.set_voice.VoiceRobotifier.set_input_device(device_name: str) -> NoneSets the device used to get audio for speech recognition purposes.device_nameshould be a name from the list returned byVoiceRobotifier.list_device_names.
If this method is never called on aVoiceRobotifierobject, it will use the system's default input device.VoiceRobotifier.set_output_device(device_name: str) -> NoneSets the device used to output the generated text-to-speech audio.device_nameshould be a name from the list returned byVoiceRobotifier.list_device_names.
If this method is never called on aVoiceRobotifierobject, it will use the system's default output device.VoiceRobotifier.list_device_names() -> List[str]Returns a list of device names on the system that can be passed as arguments toVoiceRobotifier.set_input_deviceandVoiceRobotifier.set_output_device