Showing posts with label MULTIMEDIA. Show all posts
Showing posts with label MULTIMEDIA. Show all posts

Wednesday, December 7, 2011

SMART AUDIO PLAYER

Sub Combo1_Change( )
if ListIndex=0 Then
File1.Pattern=("*.wav")
ElseIf ListIndex=1 Then
File1.Pattern=("*.mid")
Else
File1.Pattern=("*.*)
End If
End Sub
If Right(File1.Path,1) <>"\" Then
 filenam=File1.Path +"\"+File1.Filename
Else
filenam=File1.Path+File1.Filename
End If
Text1.Text=filenam
End Sub
Private Sub Play_Click( )
If Combo1.ListIndex=0 Then
MMControl1.DeviceType="WaveAudio"
ElseIf Combo1.ListIndex=1 Then
MMControll.DeviceType="Sequencer"
End If
MMControl1.FileName=Text1.Text
MMControl1.Command="Open"
MMControl1.Command="Play"
End Sub
Private Sub Dir1_Change( )
File1.Path=Dir1.Path
If Combo1.ListIndex=0 Then
File1.Pattern=("*.wav")
ElseIf Combo1.ListIndex=1 Then
File1.Pattern=("*.mid")
Else
File1.Pattern=("*.*)
End If
Private Sub Drive1.Change( )
Dir1.Path=Drive1.Drive
End Sub
Private Sub Form_Load( )
Top=(Screen.Height-Height)\2
Left=(Screen.Width-Width)\2
Combo1.Text="*.wav"
Combo1.AddItem "*.wav"
Combo1.AddItem "*.mid"
Combo1.AddItem "All files"
End  Sub
 

MULTIMEDIA PLAYER IN VB






I have created a multimedia player that can play all kinds of media files such as wav, midi, mp3, mpeg video, avi video and so on. When you launch the program, you can select files of different types from different drives. After you have selected a particular files, you can play it using the customized button or you can use the buttons of the multimedia control
In this program, you need to insert the Microsoft Multimedia Control, a combo box, a dirListBox, a DriveListBox, a fileListbox, a picture box(to play the video) , a text box and four command buttons which you label as "Play", "Open","Stop" and "Exit".One of the most important procedures is to open various audio files, the codes are as follow:

















THE CODE:- 
Private Sub Open_Click()
If Combo1.ListIndex = 0 Then
MMControl1.DeviceType = "WaveAudio"
End If
If Combo1.ListIndex = 1 Then
MMControl1.DeviceType = "Sequencer"
End If

If Combo1.ListIndex = 2 Then
MMControl1.DeviceType = "AVIVideo"
End If
If Combo1.ListIndex = 3 Then
MMControl1.DeviceType = ""

End If