当前位置:网站首页>Test the.net text to Speech module System. Researched
Test the.net text to Speech module System. Researched
2022-07-30 17:44:00 【gc_2299】
I saw an article introducing Microsoft's speech synthesis and speech recognition module System.Speech in the WeChat public account (see reference 1 for the address, Baidu did not find the corresponding article address).This article briefly tests the usage of the speech synthesis function.
Create a new Winform project, search for and install the System.Speech module in the NuGet manager, as shown in the following figure.
Convert text to speech, if there are no special requirements, a few lines of code can be done, as shown below. SpeechSynthesizer provides access to the functions of the installed speech synthesis engine, creates an instance object of this class, and sets to use the default system sound, and then call Speak (synchronous), SpeakAsync (asynchronous) and other functions to sound.A screenshot of the test program is shown below.
SpeechSynthesizer synth = new SpeechSynthesizer();synth.SetOutputToDefaultAudioDevice();synth.SpeakAsync(txtContent.Text);
SpeechSynthesizer is used by defaultThe voice is the voice of an adult female. If you want to use other voices, you can use PromptBuilder to configure it. There are many functions in this class for configuring the language. I haven't read it carefully yet, and I will learn it later.
References:
[1] WeChat public account: Xiangxing, article name: .NET 3 lines of code to achieve text-to-speech function
[2]https://docs.microsoft.com/zh-cn/dotnet/api/system.speech.synthesis.speechsynthesizer?view=netframework-4.8
边栏推荐
- 有效的括号字符串[贪心练习]
- C陷阱与缺陷 第6章 预处理器 6.1 不能忽视宏定义中的空格
- FP6606CMP5 CPC-16L USB类型-C和PD充电控制器 百盛电子代理商
- 一个 15 年 SAP ABAP 开发人员分享的 SAPGUI 一些个性化设置和实用小技巧试读版
- Mongoose module
- Arranger software FL Studio Chinese version installation tutorial and switching language tutorial
- Web3时代重要基础设施深度拆解:4EVERLAND
- X射线的应用是什么?
- 升级Win11后不喜欢怎么退回Win10系统?
- 腾讯专家献上技术干货,带你一览腾讯广告召回系统的演进
猜你喜欢
升级 MDK 5.37 后的问题处理: AC6编译选项, printf, 重启失效等
Metaverse Web 3.0 和 DeFi大师班
全球架构师峰会
ERROR 2003 (HY000) Can‘t connect to MySQL server on ‘localhost3306‘ (10061)解决办法
游戏化产品搭建思路的拆解与探究
Error EPERM operation not permitted, mkdir 'Dsoftwarenodejsnode_cache_cacach Two solutions
想要写出好的测试用例,先要学会测试设计
SQLServer下载与安装
知识蒸馏1:基础原理讲解及yolov5项目实战介绍
MySQL中的存储过程(详细篇)
随机推荐
快使用flyway管理sql脚本吧~
Express framework connects MySQL and ORM framework
Tensorflow模型量化(Quantization)原理及其实现方法
Web 3.0入门教程
un7.30:linux——如何在docker容器中安装MySQL?
Web3时代重要基础设施深度拆解:4EVERLAND
基于MATLAB的电力系统短路故障分析与仿真
js中的基础知识点 —— BOM
【解决】关于 Unity Hub 获取许可证失败 或 无响应导致无法开发的问题
如何让 JOIN 跑得更快?
bert-base调试心得
FP6606ACAW4 TQFN-20L (3mmx3mm) USB双端口充电控制器 百盛电子代理
一篇文 带你搞懂,虚拟内存、内存分页、分段、段页式内存管理(超详细)
un7.30:Linux——如何在docker容器中显示MySQL的中文字符?
数据库系统原理与应用教程(064)—— MySQL 练习题:操作题 51-61(八):查询条件的构造、通配符
matlab simulink锂离子电池智能充电策略研究
Dive deep on Netflix‘s recommender system(Netflix推荐系统是如何实现的?)
Summary of String Copy, Concatenation, Comparison and Split Functions (1)
图注意力机制
简易的命令行入门教程