Windows窗体:播放声音,而不是从一开始 [英] Windows Form: Play sound, but not from beginning

查看:279
本文介绍了Windows窗体:播放声音,而不是从一开始的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在播放曲目(.wav文件)我的 Windows窗体应用程序。但我不希望它从一开始就玩,但是从某一点在轨道地方(比方说10秒)。
要开始播放的曲目是没有问题的:

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();
}

但我怎么能跳过前10 secons,并发挥它只是休息吗?

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

在此先感谢!

推荐答案

声音播放类不支持这样做。它提供了对WAV文件一个非常简单的控制。
也许这个问题可以帮助你。

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

这篇关于Windows窗体:播放声音,而不是从一开始的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆