Speech Generation package¶
Submodules¶
i_speech_generation module¶
- class dronebuddylib.atoms.speechgeneration.i_speech_generation.ISpeechGeneration(engine_configurations: EngineConfigurations)[source]¶
Bases:
IDBLFunction
- abstract change_rate(rate: int) bool [source]¶
Changes the speech rate of the speech generation engine.
- Parameters:
rate (int) – The desired speech rate.
- Returns:
True if the rate was changed successfully, False otherwise.
- Return type:
bool
- abstract change_voice(voice_id: str) bool [source]¶
Changes the voice used by the speech generation engine.
- Parameters:
voice_id (str) – The identifier of the desired voice.
- Returns:
True if the voice was changed successfully, False otherwise.
- Return type:
bool
- abstract change_volume(volume: float) bool [source]¶
Changes the volume of the speech generation engine.
- Parameters:
volume (float) – The desired volume level.
- Returns:
True if the volume was changed successfully, False otherwise.
- Return type:
bool
speech_generation_engine module¶
- class dronebuddylib.atoms.speechgeneration.speech_generation_engine.SpeechGenerationEngine(algorithm: SpeechGenerationAlgorithm, config: EngineConfigurations)[source]¶
Bases:
object
A facade that provides a simplified interface to the underlying speech generation engines.
tts_speech_generation_impl module¶
- class dronebuddylib.atoms.speechgeneration.tts_speech_generation_impl.TTSTextToSpeechGenerationImpl(engine_configurations: EngineConfigurations)[source]¶
Bases:
ISpeechGeneration
Initiates the speechrecognition to text engine.
- change_rate(rate) bool [source]¶
Changes the speech rate of the speech generation engine.
- Parameters:
rate (int) – The desired speech rate.
- Returns:
True if the rate was changed successfully, False otherwise.
- Return type:
bool
- change_voice(voice_id) bool [source]¶
Changes the voice used by the speech generation engine.
- Parameters:
voice_id (str) – The identifier of the desired voice.
- Returns:
True if the voice was changed successfully, False otherwise.
- Return type:
bool
- change_volume(volume) bool [source]¶
Changes the volume of the speech generation engine.
- Parameters:
volume (float) – The desired volume level.
- Returns:
True if the volume was changed successfully, False otherwise.
- Return type:
bool
- get_current_configs() dict [source]¶
Gets the current configurations of the speech generation engine.
- Returns:
A dictionary containing the current configurations.
- Return type:
dict
- read_phrase(text) None [source]¶
Generates speechrecognition from the provided text using a text-to-speechrecognition engine and plays it.
- Parameters:
engine (TTS Engine) – The text-to-speechrecognition engine instance capable of generating speechrecognition.
text (str) – The text to be converted into speechrecognition and played.
- Returns:
None
Example
engine = TextToSpeechEngine() generate_speech_and_play(engine, “Hello, how can I assist you?”)
- dronebuddylib.atoms.speechgeneration.tts_speech_generation_impl.logger = <dronebuddylib.utils.logger.Logger object>¶
This is a wrapper for ttx.