freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

c播放聲音的四種方法-資料下載頁

2025-01-07 11:34本頁面
  

【正文】 else return currentPlay。 default: return 0。 } } } Player 類中包括一個 windowsMediaPlayer 對象 myPlayer,一個存儲播放列表的數(shù)組 playlist,記 彔歌 曲總數(shù)的 numOfMusic,以及當(dāng)前播放的歌曲對應(yīng)列表中的序號 currentplay; 另外有四個方法分別是 Play,AddFile,DelFile,以及獲得下次播放序號的 NextPlay 分功能列出其他主要代碼 添加單個歌曲 if(() == ) { string path = 。 FileInfo f = new FileInfo(path)。 ()。 string STRFILE = ()。 for(int i = 1。i=。i++)STRFILE+=’ ’ 。 STRFILE += 。 (STRFILE)。 } 添加一個文件夾及其所有子文件夾的歌曲 利用遞歸函數(shù) showfiles 實現(xiàn)所有層歌曲都添加到歌曲列表中。 private void showfiles(string path,ListBox listBox1) { DirectoryInfo dir = new DirectoryInfo(path)。 foreach(FileInfo f in (*.mp3)) { ()。 } foreach(DirectoryInfo f in ()) { showfiles(,listBox1)。 } 刪除和 清空 直接調(diào)用類 Player 中的 AddFile 和 DelFile 函數(shù) 實現(xiàn)播放上一首 if( = 0) { 。 if( 0) = 1。 ( + 1)。 } 下一首 if( = 0) { = ( + 1) % 。 ( + 1)。 } 播放的控制 利用 Player 的 NextPlay 方法返回的值來選擇下一次播放的內(nèi)容。 同時利用 PlayStateChange 事件來實現(xiàn)由一曲到下一曲的替換,但是在響應(yīng) PlayStateChange事件的時候直接改變 Player 的 url 無法讓它直接播放下一曲,解決方法如下 : private void axWindowsMediaPlayer1_PlayStateChange(object sender, e) { if( == ) { ()。 } } private void timer1_Tick(object sender, e) { ()。 int selectnum = 0。 if()selectnum = (0)。 else if ()selectnum = (1)。 else if ()selectnum = (2)。 else if ()selectnum = (3)。 if(selectnum != 0) { = selectnum 1。 (selectnum)。 } } 滿足一首歌曲結(jié)束的條件的時候喚醒計時器 ,計時器 100ms 內(nèi)就響應(yīng)函數(shù) timer1_Tick,在這個函數(shù)里實現(xiàn)下一首歌曲的選擇播放便可以順利迚行 . 至此主要功能便完成了!立刻用來聽聽 mp3,自己的東西感覺就是丌一樣哦! 0 0 (請您對文章做出評價 ) 閑得蛋疼,用 C寫的一個計算 mp3 播放時間長度的類,可計算 Xing、 VBRi、 CBR 三種格式的 mp3 長度。 問題寫在代碼后面 [code=C] /// summary /// 將 Mp3 轉(zhuǎn)為 byte[] /// /summary /// param name=FileNamemp3 的路徑 /param /// returns /returns public byte[] getByte(string FileName) { FileStream fs = new FileStream(FileName, ,)。 int seekPos = ()。 BinaryReader r = new BinaryReader(fs)。 (0, )。 byte[] Info = new byte[seekPos]。 Info = ((int))。 //return (byte[])EndianFlip(Info)。 return Info。 } public static object EndianFlip(object oObject) { string sFieldType。 Type tyObject = ()。 FieldInfo[] miMembers。 miMembers = ()。 for (int Looper = (0)。 Looper = (0)。 Looper++) { sFieldType = miMembers[Looper].。 if (((sFieldType, , true) == 0)) { ushort tmpUShort。 tmpUShort = (ushort)miMembers[Looper].GetValue(oObject)。 tmpUShort = (ushort)(((tmpUShort amp。 0x00ff) 8) + ((tmpUShort amp。 0xff00) 8))。 miMembers[Looper].SetValue(oObject, tmpUShort)。 } else if ((sFieldType, , true) == 0) { uint tmpInt。 tmpInt = (uint)miMembers[Looper].GetValue(oObject)。 tmpInt = (uint)(((tmpInt amp。 0x000000ff) 24) + ((tmpInt amp。 0x0000ff00) 8) + ((tmpInt amp。 0x00ff0000) 8) + ((tmpInt amp。 0xff000000) 24))。 miMembers[Looper].SetValue(oObject, tmpInt)。 } } return (oObject)。 } /// summary /// 獲取 mp3 幀頭位置 /// /summary /// param name=Infomp3 的 byte 串 /param /// returns返回 int 的幀頭位置 /returns public int getframeHeader(byte[] Info) { //(bytes[0] 8) + bytes[1] int i = 0。 ushort txt 。 ushort txt2 = 65472。 do { txt = ((Info[i] 8) + Info[i + 1])。 i++。 } while(txt txt2)。 return i1。 } /// summary /// 獲取 mp3 的版本信息 /// /summary /// param name=strmp3 的 byte /param /// param name=frameHead幀頭位置 /param /// returns /returns public string getMPEGVersion(byte[] info,int frameHead) { string strCode = 。 byte[] a = new byte[4]。 a[0] = info[frameHead]。 a[1] = info[frameHead + 1]。 a[2] = info[frameHead + 2]。 a[3] = info[frameHead + 4]。 StringBuilder sb = new StringBuilder()。 foreach (byte i in a) { (DtoB((char)i))。 } string str1 = ()。 strCode = (11, 2)。 string MPEGVersion。 switch (strCode) { case 00: MPEGVersion = MPEG 。 break。 case 01: MPEGVersion = 保留 。 break。 case 10: MPEGVersion = MPEG 2。 break。 default: MPEGVersion = MPEG 1。 break。 } return MPEGVersion。 } /// summary /// 獲取 mp3 的版本的二進(jìn)制代碼 /// /summary /// param name=strmp3 的二進(jìn)制碼 /param /// param name=frameHead幀頭位置
點擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1