 |
|
|
 |
|
 |
The instrudtions are incomplete. I gues the author should have tested it.
|
|
|
|
 |
|
 |
hi all,
I have reached to a step that the player can play and stop music that I have selected. But how may I play files that have chinese characters for their file name?
Please advise.
Thanks.
serene
|
|
|
|
 |
|
|
 |
|
 |
I need to play a files at the same time, for different devices, In vb6 i can do this, but how can i do in vb net??
hjhgfhj
|
|
|
|
 |
|
 |
Hi i am doing a mci music player in vb.net. I have done everything except a progress bar to skip song and a duration bar. How would I do this and what MCI strings would I use heres what i have done far
Private Paused As Boolean = False 'this is a class level variable
'Private close As Long
Private Declare Function mciGetErrorString Lib "winmm.dll" Alias "mciGetErrorStringA" (ByVal dwError As Long, ByVal lpstrBuffer As String, ByVal uLength As Long) As Long
_
Public Shared Function mciSendString(ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer
'Used to call MCI
End Function
Public Function PlayMCI(ByVal filename As String, Optional ByVal ShowMsg As Boolean = False) As Boolean
' close any previous commands that have opened the media
mciSendString("Close all", 0, 0, 0)
' and create the string which will open the new one
mciSendString("Open " & Chr(34) & filename & Chr(34) & " Type " & SoundFormat(filename) & _
" Alias Med", 0, 0, 0)
mciSendString("Close", 0, 0, 0)
mciSendString("Pause Med ", 0, 0, 0)
mciSendString("Open " & Chr(34) & filename & Chr(34) & " Alias Med style child parent " + PictureBox1.Handle.ToString, 0, 0, 0)
mciSendString("Play Med", 0, 0, 0)
' End If
End Function ' Play MCI
Private Function SoundFormat(ByVal FullPath As String) As String
Dim Sound As New FileInfo(FullPath)
Dim FileExt As String = Sound.Extension.ToLower
Select Case FileExt
Case ".wav"
Return "Waveaudio"
Case ".mid"
Return "Mpeg3"
Case ".mp3"
Return "MPEGVideo"
Case ".mpg"
Return "CDAudio"
Case ".wma"
Return "MPEGVideo"
Case ".mpeg"
Return "Windows Media Player"
Case Else
Return "NotSoundFile"
End Select
End Function ' SoundFormat
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
#End Region
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
mciSendString("close Med", 0&, 0, 0)
End Sub
Private Sub play_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim OpenFile As New OpenFileDialog
With OpenFile
.InitialDirectory = "G:\"
.Filter = "MP3 Files (*.mp3)/*.mp3/Wma files(*.wma)/*.wma/Wav Files(*.wav)/*.wav/Mpg Files (*.mpg) /*.mpg/flash Files (*.flvplayer) /*.flvplayer/All Files(*.*)/*.*"
'.Filter = "Mpg Files (*.mpg) /*.mpg"
.CheckFileExists = True
' Open the dialog
If .ShowDialog = DialogResult.OK Then
PlayMCI(.FileName)
'mul.wait = False
Label2.Text = .FileName
Timer1.Enabled = True
End If
End With
End Sub
Private Sub Stop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
mciSendString("Close all", 0, 0, 0)
End Sub
Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
mciSendString("seek Med to " & TrackBar1.Value, 0&, 0, 0)
mciSendString("Play Med", 0, 0, 0)
TrackBar1.Minimum = 0
TrackBar1.Maximum = 24000
TrackBar1.SmallChange = 1000 'To make intervale of 1 second...
End Sub
Private Sub ProgressBar1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProgressBar1.Click
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
End Sub
|
|
|
|
 |
|
 |
Hi I'm an almost comlete beginner trying to write a midi jukebox app ( I am a pro musician wrote a midi jukebox prog in GFA basic on Atari ! )
I've done everything as you said. - put a button on the form and put the play code into the button_click section . The prog stops and hilights the line
lRet = mciSendString("stop track", "", 0, 0
in the Private function stopfile() section in green and says ' PInvokeStackImbalance has been detected and some stuff I don't understand . Can you help
Thanks Tony ( in France )
|
|
|
|
 |
|
 |
My application has a module in which we want to be able to give the user an option to add a voice tag to their module. Any idea what classes I could use to do that ? I tried a bunch of the stuff available online but nothing really worked ?
-Parik.
http://parik.in
|
|
|
|
 |
|
 |
Hi. I can play the mid files with no problem, and now i wish to make my program into an installation package. I followed the instruction, but it raises an error when I trying to add the primary output, it says
"The following files may have dependencies that cannot be determind automatically. Please cofirm that all dependencies have been added to te project.
c:\winnt\system32\dx7vb.dll"
what shoud I do.
Thank you
|
|
|
|
 |
 | Help!  |  | Anonymous | 10:37 29 Jan '05 |
|
 |
Sorry, this may sound like a stupid question, but what do you mean by "Make a reference to DirectX7 COM-Object"? And could this be why I have build errors in that class when i try and compile it? Also, the sound doesnt play.
|
|
|
|
 |
|
 |
To add a reference, go to the project menu and select add reference close to the bottom, select the .com sub-menu
and find directx 7, click select and then ok. The problems should be fixed.
|
|
|
|
 |
|
 |
I'm very new to programming. I created your SoundPlayer. Where do the "Dim Sound As New SoundPlayer (".\sound\testmidi.mid")... code lines fit in? Are these put into the same "class" file that was added?Also, how would I play 3 files sequentially...no pause in between. Thanks for any help!
|
|
|
|
 |
|
 |
hi, i am also new to VB_NET.
I struggle quite a while on this (no sound coming out). because when invalid file given, the program did not give warning...
Now finally able to play mid sound.
"Dim Sound As New SoundPlayer (".\sound\testmidi.mid")... code can fit in your Private Sub form1_Load and any other SUB under the Public form1 class...
you can put your test.mid in bin directory then use "Dim Sound As New SoundPlayer ("test.mid")"
[Initially i tried (".test.mid") which is not valid]
|
|
|
|
 |
|
 |
please show me the code how to detect the midi have finished
thx from indonesia
|
|
|
|
 |
|
|
 |
|
|
 |