我正在制作一个.wav播放器应用程序,其中有一个按钮可以播放加载的.wav
因此,如果声音正在播放,将显示“暂停”按钮,停止播放时将显示“播放”按钮。
当前正在使用此:
using (SoundPlayer player = new SoundPlayer(label1.Text))
{
pictureBox1.Image = Form1.Properties.Resources.play_button;
try
{
player.Play();
}
catch (FileNotFoundException)
{
MessageBox.Show("File has been moved." + "\n" + "Please relocate it now!");
}
}
有办法吗?
如果是怎么做的?
如果可能的话,来源?
最佳答案
您可能需要声音播放器以外的其他东西……我在msdn上看不到任何让您暂停或捕获onpause事件的内容……尝试使用mediaplayer类吗?
关于audio - 声音停止播放时C#更改图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14035187/