| | |
Media Player load in game
Thread Solved |
Alright my family of geniuses here is my new dilemma.
In a card game I have created via VB6 I thought it would be great to spiff it up with music during game play. The problem however is I have no idea where to begin. I have read some posts but nothing really grabbed me as to what to do.
Here is what I'm trying to do, I want a built in player if you will, with a list of songs to choose from and to be able to pause and skip to the next song via this built in player. (Hopefully I'm not crazy and asking the impossible)
I figure it would just start automatically in the Form Load.
Thanks in advance
In a card game I have created via VB6 I thought it would be great to spiff it up with music during game play. The problem however is I have no idea where to begin. I have read some posts but nothing really grabbed me as to what to do.
Here is what I'm trying to do, I want a built in player if you will, with a list of songs to choose from and to be able to pause and skip to the next song via this built in player. (Hopefully I'm not crazy and asking the impossible)
I figure it would just start automatically in the Form Load.
Thanks in advance
I like it here! This is my family of geniuses!
Venomocity
Venomocity
Module:
Play Button:
Then research MCI with vb6.
vb Syntax (Toggle Plain Text)
Declare Function mciSendString Lib "winmm" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
vb Syntax (Toggle Plain Text)
CommandString = "open """ & FileName & """ type mpegvideo alias " & FileName RetVal = mciSendString(CommandString, vbNullString, 0, 0)
Comatose you always come through for me, but I have failed. I downloaded MCI Conversation which came with a frm and other things but I couldn't seem to understand how it was to work. I tried your code but it failed. I know its me and sorry to pester but would you have an example of how it should look with a test song or something? Just in a standard Form Load or something?
Thanks for all your help!
Thanks for all your help!
I like it here! This is my family of geniuses!
Venomocity
Venomocity
What blanks? He didn't give you any blanks. The only thing he left as a variable is the filename of the audio file you wish to play. Nobody would know that except you. The only thing I don't agree with in his code is using the Filename as the alias. If you are giving a full path, this might cause you problems, I believe. The alias can be whatever you want.
vb Syntax (Toggle Plain Text)
' In your global declarations Declare Function mciSendString Lib "winmm" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long ' In your sub procedure Dim FileName as String ' Set the value of FileName equal to the path of your audio file CommandString = "open """ & FileName & """ type mpegvideo alias backSong" RetVal = mciSendString(CommandString, vbNullString, 0, 0) ' From here, you can do any number of things, but the first thing ' You'll want to do is play it with RetVal = mciSendString("play backSong", vbNullString, 0, 0) ' All of your other options can be found here: ' http://msdn.microsoft.com/en-us/library/ms712587(VS.85).aspx
Last edited by SlyMaelstrom; Mar 4th, 2009 at 3:28 pm.
Ah, thanks SlyMaelstrom! You were right, he didn't leave blank, but I overlooked a Filename where I didn't enter the path. But I like your string as well. I'll keep both for the future! And thanks for the suggestion vb5prgrmr. I appreciate all the help!
I like it here! This is my family of geniuses!
Venomocity
Venomocity
![]() |
Similar Threads
- really need help getting rid of virus's and worms (Viruses, Spyware and other Nasties)
- help, infected computer i think (Viruses, Spyware and other Nasties)
- Pictures don't Load? (Viruses, Spyware and other Nasties)
- Computer Acting Strange... Very Strange (Viruses, Spyware and other Nasties)
- "Virus Alert!" In Taskbar, Hijackthis log included (Viruses, Spyware and other Nasties)
- Running vista, error at startup, freezing. (Troubleshooting Dead Machines)
- Browser opening by itself. (Viruses, Spyware and other Nasties)
- Network Login Issue (Please Help!) (Windows NT / 2000 / XP)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: count element in table html
- Next Thread: Need Help With Project Basketball Simulator
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






