language_service package
asr
This is “asr.py” file.
- async language_service.asr.transcribe_and_translate(file_name, language_code, sample_rate_hertz=16000)[source]
Generate transcriptions (text) and confidence score for a given audio or voice file in a specified language using an ASR model.
Note: The original method call is as below. Due to some ‘Documentation Syntax requiremets’ issues we have removed a parameter in the function call. async def transcribe_and_translate( file_name, language_code, encoding_format=speech.RecognitionConfig.AudioEncoding.MP3, sample_rate_hertz=16000
):
translation
This is “translation.py”
- async language_service.translation.a_translate_to(text: str, lang_code: str) str[source]
Translate a given text to specified language.
tts
This is “tts.py”
- async language_service.tts.synthesize_speech(input_text: str, input_language: str, id_string: str | None = None, aiohttp_session=None, sample_rate_hertz=48000) str[source]
- async language_service.tts.synthesize_speech_azure(text_to_synthesize, language_code, aiohttp_session)[source]
Synthesise speech using Azure TTS model. Azure TTS Docs
utils
This is “utils.py”