Skip to content

Commit

Permalink
fix: remove hyphens from text to generate
Browse files Browse the repository at this point in the history
  • Loading branch information
MrPandir committed Mar 1, 2024
1 parent 5b1c737 commit a3a6d9d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tts/tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ def _load_speakers(self, model: "TTSModelMultiAcc_v3", language: str):
def _generate_audio(
self, model: "TTSModelMultiAcc_v3", text: str, speaker: str, sample_rate: int
) -> bytes:
# This fixes the problem:
# https://github.com/twirapp/silero-tts-api-server/issues/8
text = text.replace("-", "").replace("‑", "")

try:
audio: torch.Tensor = model.apply_tts(text=text, speaker=speaker, sample_rate=sample_rate)
except ValueError:
Expand Down

0 comments on commit a3a6d9d

Please sign in to comment.