api_speech2text#

class besser.bot.nlp.speech2text.api_speech2text.APISpeech2Text(nlp_engine)[source]#

Bases: Speech2Text

Makes use of the python speech_recognition library.

The library calls to different speech recognition engines/APIs.

Currently, supports:

Google Speech Recognition

Parameters:

nlp_engine (NLPEngine) – the NLPEngine that handles the NLP processes of the bot

_sr_engine#

the chosen SR engine

Type:

str

_language#

the chosen language

Type:

str

_abc_impl = <_abc._abc_data object>#
speech2text(speech)[source]#

Transcribe a voice audio into its corresponding text representation.

Parameters:

speech (bytes) – the recorded voice that wants to be transcribed

Returns:

the speech transcription

Return type:

str