Windows Form: Play sound, but not from beginning

孤街浪徒 提交于 2019-12-11 00:36:39

问题


I want to play a track (.wav file) in my Windows Forms Application. But I do not want it to play from the beginning, but from a certain point somewhere in the track (let's say 10 seconds). To play the track from beginning is no problem:

private void playSimpleSound()
{
    SoundPlayer simpleSound = new SoundPlayer(@"c:\Windows\Media\sound.wav");
    simpleSound.Play();
}

But how can I skip the first 10 secons, and play only the rest of it?

Thanks in advance!


回答1:


SoundPlayer class not to support to do this. It gives a very simple control on WAV files. Maybe this question can help you.



来源:https://stackoverflow.com/questions/25876872/windows-form-play-sound-but-not-from-beginning

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!