using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Speech.Synthesis;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TextToSpeech
{
public partial class Form1 : Form
{
private SpeechSynthesizer speech;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
/*
using (var synth = new SpeechSynthesizer())
{
synth.SelectVoiceByHints(VoiceGender.Male); // 选择男性发音人员
synth.Volume = 50;// 设置音量大小
synth.Rate = 0; // 设置速度变化值
string textToConvert = "你好";
synth.SpeakAsync(textToConvert);
C#文字转语音代码
最新推荐文章于 2025-06-19 10:59:11 发布