axWindowsMediaPlayer1获取音频长度

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
OpenFileDialog openFileDialog1 = new OpenFileDialog
          {
              InitialDirectory = "c:\\",
              Filter = "音频文件(*.mp3,*.s48)|*.Mp3;*.s48",
              FilterIndex = 2,
              RestoreDirectory = true
          };     //显示选择文件对话框
          var path = "";
          if (openFileDialog1.ShowDialog() == DialogResult.OK)
          {
              path = openFileDialog1.FileName;          //显示文件路径
          }
          if (path.Length == 0)
          {
              MessageBox.Show("您还没有选择任何文件!");
              return;
          }
          IWMPMedia mediaInfo = axWindowsMediaPlayer1.newMedia(path);
 
          axWindowsMediaPlayer1.URL = path;
          MessageBox.Show(mediaInfo.duration.ToString());

  

axWindowsMediaPlayer1获取音频长度,布布扣,bubuko.com

axWindowsMediaPlayer1获取音频长度

上一篇:PS抠图:图层模式中的“颜色混合带”


下一篇:MAYA制作漂亮有意境的荷塘月色水墨动画