当前位置: 首页 > news >正文

TTS微软Azure

微软Azure

https://portal.azure.com/ 注册后绑定visa卡
image

创建微软语音服务

创建资源
image
选择AI应用和代理 -》 语音
image
输入语音服务必填项
image
然后点击创建
image
创建完成后如下
image
点击转到资源

语音服务

image
点击转到SpeechStudio
image
语音库
image
没有有声内容创作,切换到旧外观
image
出现有声内容创作
image

SDK

开发文档:
https://learn.microsoft.com/en-us/azure/ai-services/speech-service/get-started-text-to-speech?tabs=macos&pivots=programming-language-csharp
Github示例代码:
https://github.com/Azure-Samples/cognitive-services-speech-sdk

Python代码调用

VSCode下载Azure AI Speech Toolkit
image

Python代码调用API

安装azure包

pip install azure-cognitiveservices-speech
import os
import azure.cognitiveservices.speech as speechsdk# This example requires environment variables named "SPEECH_KEY" and "ENDPOINT"
# Replace with your own subscription key and endpoint, the endpoint is like : "https://YourServiceRegion.api.cognitive.microsoft.com"
speech_config = speechsdk.SpeechConfig(subscription=os.environ.get('SPEECH_KEY'), endpoint=os.environ.get('ENDPOINT'))
audio_config = speechsdk.audio.AudioOutputConfig(use_default_speaker=True)# The neural multilingual voice can speak different languages based on the input text.
speech_config.speech_synthesis_voice_name='zh-CN-XiaoxiaoNeural'speech_synthesizer = speechsdk.SpeechSynthesizer(speech_config=speech_config, audio_config=audio_config)# Get text from the console and synthesize to the default speaker.
print("Enter some text that you want to speak >")
text = input()speech_synthesis_result = speech_synthesizer.speak_text_async(text).get()if speech_synthesis_result.reason == speechsdk.ResultReason.SynthesizingAudioCompleted:print("Speech synthesized for text [{}]".format(text))
elif speech_synthesis_result.reason == speechsdk.ResultReason.Canceled:cancellation_details = speech_synthesis_result.cancellation_detailsprint("Speech synthesis canceled: {}".format(cancellation_details.reason))if cancellation_details.reason == speechsdk.CancellationReason.Error:if cancellation_details.error_details:print("Error details: {}".format(cancellation_details.error_details))print("Did you set the speech resource key and endpoint values?")
http://www.sczhlp.com/news/81789/

相关文章:

  • 潍坊建设局网站制作微信公众号网站开发
  • 重庆锅炉网站建设公司学校官方网站的建设目标是什么
  • 临沂 网站优化大连信息网
  • 做极速赛车网站如何进行网站设计规划
  • 做网站前端用什么软件免费网络节点
  • 搜狐做网站网络服务合同模板
  • 广州最近传染病情况seo深圳网络推广
  • 在贸易网站怎么做贸易wordpress 推送 微信
  • 工业园企业建设网站公司怎么在wordpress免费注册博客网站
  • 网站建设类工作描述重庆公司网站建设价格
  • 湛江知名网站建设电话app和网站哪个有优势
  • 单页网站制作 在线 支付wordpress平台搭建
  • 成华区网站建设公司服务公司发展战略
  • 西蔵自治区建设厅网站建设网站以后怎么让百度收录呢
  • 12.6 类的封装
  • 深度解码你自己看着办:职场新人必须掌握的潜台词破解术
  • 6 个替代 Jira 的开源项目管理工具推荐
  • 哪里有做桥梁模型的网站永久免费自助建站
  • 最新做做网站网站建设 500强建站
  • 南京市住宅建设总公司网站天河建设网站专家
  • 2019建设摩托官方网站网站制公司
  • 做惠而浦售后网站赚钱专业网页制作什么价格
  • 晚上睡不着推荐个网站保定php网站制作
  • 怎么制作网站教程图片搜题公众号怎么制作
  • 营销型网站框架零基础培训网页设计
  • 自助建站平台搭建北滘建网站
  • 烟台住房和城乡建设厅网站营销型网站的三大特点
  • 记录一个Windows上的键盘鼠标模拟库和沟子库--Input
  • 惊世骇俗:《易经》六十四卦与数学公理完整映射表
  • 做曖网站公共货运平台