fix: get correct audio format in pytts

This commit is contained in:
lanvent
2023-04-01 20:58:06 +08:00
parent 1545a9f262
commit 18aa5ce75c
6 changed files with 49 additions and 39 deletions

View File

@@ -56,7 +56,7 @@ class AzureVoice(Voice):
return reply
def textToVoice(self, text):
fileName = TmpDir().path() + '语音回复_' + str(int(time.time())) + '.mp3'
fileName = TmpDir().path() + '语音回复_' + str(int(time.time())) + '.wav'
audio_config = speechsdk.AudioConfig(filename=fileName)
speech_synthesizer = speechsdk.SpeechSynthesizer(speech_config=self.speech_config, audio_config=audio_config)
result = speech_synthesizer.speak_text(text)