c#调用api播放MP3的问题。。。高手求救

来源:百度知道 编辑:UC知道 时间:2024/05/17 02:05:20
foreach很快,所以只能听到最后一条的声音。
我要想全部播怎么办?难道要让线程休眠一会?但是也不行啊,用户体验太差。也不知道要休眠多少时间,因为每个MP3的长度不一样。
请问api里有没有检查文件是否播完的方法?或者用个timer控件,但是没有思路。请大家帮帮忙。

#region 点击试听 播放MP3
private void ie语音_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
{
if (1 == e.Button.Index)
{
string mp3 = "";
DevExpress.XtraEditors.MemoExEdit mee = sender as DevExpress.XtraEditors.MemoExEdit;
foreach (string str in mee.Lines)
{
mp3 = @"E:\原始语音\test\" + str;
MP3API.Sound.Play(mp3);
}

}
}
#endregion

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Collections;
using System.Runtime.InteropServices;
using System.Diagnost

乱七八糟的,我用MP4都不会像你一样乱,你弄的好乱,看了头都晕了!你自己看一下说明书不就OK了

1楼是电脑盲,肯定没听说过C#.NET
鉴定完毕

同意二楼!