using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using SpeechLib;
namespace WindowsFormsAppOne
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
label1.Text = "欢迎入住!";
}
private void CheckInButton_Click(object sender, EventArgs e)
{
SpeechVoiceSpeakFlags flag = SpeechVoiceSpeakFlags.SVSFlagsAsync;
SpVoice voice = new SpVoice();
String voice_txt = label1.Text;
voice.Voice = voice.GetVoices(string.Empty, string.Empty).Item(0);
voice.Speak(voice_txt,flag);
}
}
}
如需转载,请注明出处!