|
-
May 20th, 2001, 01:50 PM
#1
Sounds
A lot of sites say to use the mci control to play sound files, but i couldt find this (im using vb6 prof) so i am trying to use the api but my code doest appear to be working. This is my code:
Public Declare Function mciSendString Lib "winmm.dll" Alias _
"mciSendStringA" (ByVal lpszCommand As String, ByVal _
lpszReturnString As String, ByVal cchReturnLength As Long, _
ByVal hwndCallback As Long) As Long
Sub Play_File(Path As String, Name As String)
Call mciSendString("Open " & Path & " alius " & Name, "", 0, 0)
Call mciSendString("Play " & Name, "", 0, 0)
End Sub
Sub Stop_File(Name As String)
Call mciSendString("Close " & Name, "", 0, 0)
End Sub
Anyone have any ideas as to the problem/if the mcicontrol goes by a different name in the components list?
Thanks
-
May 20th, 2001, 02:13 PM
#2
Frenzied Member
This is API, no MCI control. Here is a syntax error in your code!
Code:
Call mciSendString("Open " & Path & " alius " & Name, "", 0, 0)
'make it
Call mciSendString("Open " & Path & " alias " & Name, "", 0, 0)
-
May 20th, 2001, 02:18 PM
#3
Still doest work. Am i using the wrong type of file? I have tried it with a wav and a midi.
-
May 20th, 2001, 03:10 PM
#4
Frenzied Member
Try this
Code:
mciSendString("OPEN " + Path + " TYPE SEQUENCER ALIAS " + Name, 0&, 0, 0)
-
May 20th, 2001, 05:11 PM
#5
Still doest work!!!! Nor does this code http://www.allapi.net/api/api221.php !!!
I am begining to suspect there is something wrong with my pc. i know the files i am trying to play are fine coz i can play them in winamp.
-
May 20th, 2001, 05:16 PM
#6
ive found the problem. Despite the fact that i am running win98, it needs to have the path passed a dos one, so c:\program files\file1.mid would need to be c:\progra~1\file.mid. I looked this api call up on several sites but all neglected to mention this major issue!
-
May 20th, 2001, 11:27 PM
#7
Good Ol' Platypus
Because usually you would have it stored locally, eg.
App.Path & "\mymid.mid"
But if this isn't the case then yes, that is a huge problem.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
May 21st, 2001, 06:57 AM
#8
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|