Skip to content

Voice

Voice Module for dost.This module contains all the functions related to voice recognition and text to speech.

Examples:

>>> from dost import voice
>>> voice.text_to_speech(text="Hello World")

This module contains the following functions:

  • speech_to_text(): Converts speech to text.
  • text_to_speech(text, show, rate): Converts text to speech.

speech_to_text()

Converts speech to text

Returns:

Name Type Description
string str

Text from the speech

Examples:

>>> voice.speech_to_text()
"Hello World"

text_to_speech(text, show=True, rate=170)

Converts text to speech offline

Parameters:

Name Type Description Default
text string

Text to be converted to speech

required
show bool

Whether to print the text or not

True
rate int

Rate of speech. Default is 170

170

Examples:

>>> voice.text_to_speech(text="Hello World")