piper_text2speech#

class baf.nlp.text2speech.piper_text2speech.PiperText2Speech(agent, model_name='mbarnig/lb_rhasspy_piper_tts', language=None)[source]#

Bases: Text2Speech

A Piper Text2Speech implementation.

It loads a specific Piper model running in a Docker container to perform the Speech2Text task. Piper Model: https://huggingface.co/mbarnig/lb_rhasspy_piper_tts

Parameters:

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

_model_name#

The Piper model name

Type:

str

_piper_api_url#

The URL to the docker container containing the API

Type:

str

_sample_rate#

The model’s actual sample rate

Type:

int

_dtype#

The audio dtype

_abc_impl = <_abc._abc_data object>#
text2speech(text)[source]#

Sends text to the Dockerized Piper service and plays the audio.