溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

VB語言中如何進(jìn)行mp3音樂鬧鐘開發(fā)

發(fā)布時間:2022-01-14 19:47:00 來源:億速云 閱讀:134 作者:柒染 欄目:大數(shù)據(jù)

本篇文章為大家展示了VB語言中如何進(jìn)行mp3音樂鬧鐘開發(fā),內(nèi)容簡明扼要并且容易理解,絕對能使你眼前一亮,通過這篇文章的詳細(xì)介紹希望你能有所收獲。

mp3音樂鬧鐘開發(fā)

如何播放指定音樂?

VB中播放音樂利用的是window media player

能夠播放mp3、m4a等格式的音頻

如何進(jìn)行音樂控制?

需要使用代碼控制

界面:

VB語言中如何進(jìn)行mp3音樂鬧鐘開發(fā)

項(xiàng)目列表(這里還有一個音樂文件1.m4a):

VB語言中如何進(jìn)行mp3音樂鬧鐘開發(fā)

源代碼:

Option ExplicitDim startMusictime As DatePrivate Sub Command1_Click()WindowsMediaPlayer1.URL = App.Path & "\1.m4a"End Sub

Private Sub Command2_Click()
If Command2.Caption = "重新設(shè)置" Then    Option1.Enabled = True    Option2.Enabled = True    Option3.Enabled = True    Command2.Caption = "設(shè)置音樂定時"    Picture1.Cls    Exit SubEnd If
If Option1.Value Then    startMusictime = DateAdd("s", 5 * 60, Now)    Picture1.Print startMusictime & "開始播放音樂"ElseIf Option2.Value Then    startMusictime = DateAdd("s", 10 * 60, Now)    Picture1.Print startMusictime & "開始播放音樂"ElseIf Option3.Value Then        startMusictime = CDate(Text1.Text)    Picture1.Print startMusictime & "開始播放音樂"Else    MsgBox "請選擇時間"    Exit SubEnd If
Option1.Enabled = FalseOption2.Enabled = FalseOption3.Enabled = FalseCommand2.Caption = "重新設(shè)置"End Sub
Private Sub Command3_Click()If Command3.Caption = "暫停" Then    WindowsMediaPlayer1.Controls.pause    Command3.Caption = "繼續(xù)播放"ElseIf Command3.Caption = "繼續(xù)播放" Then    WindowsMediaPlayer1.Controls.play    Command3.Caption = "暫停"End IfEnd Sub
Private Sub Option3_Click()Text1.Text = NowEnd Sub
Private Sub Timer1_Timer()Label1.Caption = "現(xiàn)在時間:" & NowIf Now = startMusictime Then    WindowsMediaPlayer1.URL = App.Path & "\1.m4a"End IfEnd Sub

上述內(nèi)容就是VB語言中如何進(jìn)行mp3音樂鬧鐘開發(fā),你們學(xué)到知識或技能了嗎?如果還想學(xué)到更多技能或者豐富自己的知識儲備,歡迎關(guān)注億速云行業(yè)資訊頻道。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI