Skip to content

Commit

Permalink
Merge pull request dnhkng#3 from lcdr/main
Browse files Browse the repository at this point in the history
Fix bugs in tts.py
  • Loading branch information
dnhkng authored Jan 22, 2024
2 parents ce58f96 + dbefa2d commit 9933e71
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions glados/tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,12 +436,13 @@ def generate_speech_audio(self, text: str) -> bytes:
for sentence in phonemes:
audio_chunk = self.synthesizer.say_phonemes(sentence)
audio.append(audio_chunk)
audio = np.concatenate(audio, axis=1).T
if audio:
audio = np.concatenate(audio, axis=1).T
return audio


if __name__ == "__main__":
tts = TTSEngine(MODEL_PATH, USE_CUDA)
audio = tts._generate_audio("Hello world. How are you?")
sd.play(audio.T, RATE)
sd.sleep(int(1000 * audio.shape[1] / RATE))
audio = tts.generate_speech_audio("Hello world. How are you?")
sd.play(audio, RATE)
sd.wait()

0 comments on commit 9933e71

Please sign in to comment.