close
C#媒體影音--如何播放聲音

播放聲音

範例一:

  using System.Media
  SoundPlayer simpleSound = new SoundPlayer(@"c:\Windows\Media\chimes.wav");
  simpleSound.Play();
	

範例二:SoundPlayer Class

            System.Reflection.Assembly a = System.Reflection.Assembly.GetExecutingAssembly();
            System.IO.Stream s = a.GetManifestResourceStream("<AssemblyName>.chimes.wav");
            SoundPlayer player = new SoundPlayer(s);
            player.Play();
	

顯示聲波

  1. Sound visualizer in C#

格式轉換

  1. http://www.codeproject.com/Articles/15588/Sound-recording-and-encoding-in-MP3-format

參考文獻

  1. How to: Play a Sound from a Windows Form
  2. SoundPlayer Class 陳鍾誠 (2012年02月14日),(網頁標題) Sound,(網站標題) 免費電子書:C# 程式設計,2012年02月14日,取自 http://cs0.wikidot.com/sound ,網頁修改第 2 版。

arrow
arrow
    創作者介紹
    創作者 Johnson峰 的頭像
    Johnson峰

    Johnson峰的部落格

    Johnson峰 發表在 痞客邦 留言(0) 人氣()