Closed ZORfree closed 6 months ago
已解决你提的需求,现在可以这样调用:
// 获取一个PlayerAudio对象
static void getPlayer(string msg, eVoice voice)
{
var player = Edge_tts.GetPlayer(msg, voice);
Console.WriteLine("开始播放");
player.PlayAsync();
Thread.Sleep(3000);
Console.WriteLine("暂停播放");
player.Pause();
Thread.Sleep(3000);
Console.WriteLine("继续播放");
player.PlayAsync();
Thread.Sleep(5000);
player.Stop();
Console.WriteLine("结束播放");
}
简单好用,就是如果文本过长,缺少stopPlay的接口