我正在使用 System.Media.SoundPlayer
用于在传递声音位置的 C# 桌面应用程序中播放声音。
一切正常。但是如何访问总文件长度(以毫秒为单位)和播放器位置?
可以访问这些属性吗?
最佳答案
System.Media.SoundPlayer 类不适合提供此信息。
http://msdn.microsoft.com/en-us/library/system.media.soundplayer.aspx
The SoundPlayer class provides a simple interface for loading and playing a .wav file. The SoundPlayer class supports loading a .wav file from a file path, a URL, a Stream that contains a .wav file, or an embedded resource that contains a .wav file.
您可能想查看其他一些用于音频播放的库,此处建议:
C# Audio Library
关于c# - 播放声音 : accessing length and position,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14603295/