所以我尝试使用Azure认知语音来生成TTS,但它没有生成任何输出,这段代码在ubuntu和mac上运行得很好,但在我的windows机器上无法工作
import azure.cognitiveservices.speech as speechsdk
from azure.cognitiveservices.speech import AudioDataStream, SpeechConfig, SpeechSynthesizer, SpeechSynthesisOutputFormat
from azure.cognitiveservices.speech.audio import AudioOutputConfig
close_file = "tes.wav"
closer = "placeholder text commonly used in the graphic, print, and publishing industries for previewing layouts and visual mockups."
speech_config = SpeechConfig(subscription="API", region="asdasd")
speech_config.speech_synthesis_voice_name = "en-US-GuyNeural"
audio_config = AudioOutputConfig(filename=close_file)
synthesizer = SpeechSynthesizer(speech_config=speech_config, audio_config=audio_config)
synthesizer.speak_text_async(closer)
字符串
1条答案
按热度按时间shyt4zoc1#
验证码:
字符串
输出:
它成功运行,并给出如下输入文本的音频输出,
的数据