1
0
mirror of https://github.com/malarinv/jasper-asr.git synced 2026-03-10 03:12:34 +00:00
Files
jasper-asr/jasper/data_utils/tts/ttsclient.py
2020-04-08 18:53:49 +05:30

27 lines
620 B
Python

"""
TTSClient Abstract Class
"""
from abc import ABC, abstractmethod
class TTSClient(ABC):
"""
Base class for TTS
"""
@abstractmethod
def text_to_speech(self, text: str, num_channels: int, sample_rate: int,
audio_encoding) -> bytes:
"""
convert text to bytes
Arguments:
text {[type]} -- text to convert
channel {[type]} -- output audio bytes channel setting
width {[type]} -- width of audio bytes
rate {[type]} -- rare for audio bytes
Returns:
[type] -- [description]
"""