ciyidogan commited on
Commit
b5d0779
·
verified ·
1 Parent(s): 92bee10

Update tts_interface.py

Browse files
Files changed (1) hide show
  1. tts_interface.py +3 -2
tts_interface.py CHANGED
@@ -46,7 +46,7 @@ class ElevenLabsTTS(TTSInterface):
46
 
47
  def __init__(self, api_key: str):
48
  super().__init__()
49
- self.api_key = api_key
50
  self.base_url = "https://api.elevenlabs.io/v1"
51
  self.default_voice_id = "2thYbn2sOGtiTwd9QwWH" # Avencia
52
 
@@ -59,6 +59,7 @@ class ElevenLabsTTS(TTSInterface):
59
  TTSPreprocessor.PREPROCESS_PERCENTAGE # Yüzdeler
60
  }
61
 
 
62
  self.preprocessor = TTSPreprocessor(language="tr")
63
 
64
  async def synthesize(
@@ -72,7 +73,7 @@ class ElevenLabsTTS(TTSInterface):
72
  """Convert text to speech using ElevenLabs API"""
73
 
74
  # Preprocess text
75
- processed_text = self.preprocessor.preprocess(text, self.preprocessing_flags)
76
 
77
  # Use defaults if not provided
78
  voice_id = voice_id or self.default_voice_id
 
46
 
47
  def __init__(self, api_key: str):
48
  super().__init__()
49
+ self.api_key = api_key.strip() # Başındaki/sonundaki boşlukları temizle
50
  self.base_url = "https://api.elevenlabs.io/v1"
51
  self.default_voice_id = "2thYbn2sOGtiTwd9QwWH" # Avencia
52
 
 
59
  TTSPreprocessor.PREPROCESS_PERCENTAGE # Yüzdeler
60
  }
61
 
62
+ # tr-TR -> tr dönüşümü
63
  self.preprocessor = TTSPreprocessor(language="tr")
64
 
65
  async def synthesize(
 
73
  """Convert text to speech using ElevenLabs API"""
74
 
75
  # Preprocess text
76
+ processed_text = self.preprocessor.process(text, self.preprocessing_flags)
77
 
78
  # Use defaults if not provided
79
  voice_id = voice_id or self.default_voice_id