Jerich commited on
Commit
9cf7097
·
verified ·
1 Parent(s): bc9a053

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -197,10 +197,10 @@ class TalklasTranslator:
197
  # Apply pitch-shifting based on voice_gender
198
  if voice_gender.lower() == "female":
199
  # Increase pitch (e.g., +4 semitones for a more traditionally feminine voice)
200
- speech = librosa.effects.pitch_shift(speech, sr=self.tts_model.config.sampling_rate, n_steps=4)
201
  elif voice_gender.lower() == "male":
202
  # Decrease pitch (e.g., -4 semitones for a more traditionally masculine voice)
203
- speech = librosa.effects.pitch_shift(speech, sr=self.tts_model.config.sampling_rate, n_steps=-4)
204
 
205
  # Convert to 16-bit PCM
206
  speech = (speech * 32767).astype(np.int16)
 
197
  # Apply pitch-shifting based on voice_gender
198
  if voice_gender.lower() == "female":
199
  # Increase pitch (e.g., +4 semitones for a more traditionally feminine voice)
200
+ speech = librosa.effects.pitch_shift(speech, sr=self.tts_model.config.sampling_rate, n_steps=1)
201
  elif voice_gender.lower() == "male":
202
  # Decrease pitch (e.g., -4 semitones for a more traditionally masculine voice)
203
+ speech = librosa.effects.pitch_shift(speech, sr=self.tts_model.config.sampling_rate, n_steps=-2)
204
 
205
  # Convert to 16-bit PCM
206
  speech = (speech * 32767).astype(np.int16)