Media Player load in game

Thread Solved

Join Date: Aug 2007
Posts: 15
Reputation: venomocity is an unknown quantity at this point 
Solved Threads: 0
venomocity's Avatar
venomocity venomocity is offline Offline
Newbie Poster

Media Player load in game

 
0
  #1
Feb 26th, 2009
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
I like it here! This is my family of geniuses!
Venomocity
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Media Player load in game

 
0
  #2
Feb 26th, 2009
Module:
  1. 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
Play Button:
  1. CommandString = "open """ & FileName & """ type mpegvideo alias " & FileName
  2. RetVal = mciSendString(CommandString, vbNullString, 0, 0)
Then research MCI with vb6.
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 15
Reputation: venomocity is an unknown quantity at this point 
Solved Threads: 0
venomocity's Avatar
venomocity venomocity is offline Offline
Newbie Poster

Re: Media Player load in game

 
0
  #3
Feb 27th, 2009
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!
I like it here! This is my family of geniuses!
Venomocity
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 15
Reputation: venomocity is an unknown quantity at this point 
Solved Threads: 0
venomocity's Avatar
venomocity venomocity is offline Offline
Newbie Poster

Re: Media Player load in game

 
0
  #4
Mar 4th, 2009
What I was asking for, is maybe you could provide it in a frm like in a zip or something. Cuz I'm too retarded to fill in the blanks I guess.
I like it here! This is my family of geniuses!
Venomocity
Reply With Quote Quick reply to this message  
Join Date: Oct 2005
Posts: 21
Reputation: SlyMaelstrom is an unknown quantity at this point 
Solved Threads: 2
SlyMaelstrom's Avatar
SlyMaelstrom SlyMaelstrom is offline Offline
Newbie Poster

Re: Media Player load in game

 
0
  #5
Mar 4th, 2009
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.

  1. ' In your global declarations
  2. 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
  3.  
  4. ' In your sub procedure
  5. Dim FileName as String
  6. ' Set the value of FileName equal to the path of your audio file
  7.  
  8. CommandString = "open """ & FileName & """ type mpegvideo alias backSong"
  9. RetVal = mciSendString(CommandString, vbNullString, 0, 0)
  10.  
  11. ' From here, you can do any number of things, but the first thing
  12. ' You'll want to do is play it with
  13. RetVal = mciSendString("play backSong", vbNullString, 0, 0)
  14.  
  15. ' All of your other options can be found here:
  16. ' http://msdn.microsoft.com/en-us/library/ms712587(VS.85).aspx
Last edited by SlyMaelstrom; Mar 4th, 2009 at 3:28 pm.
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 805
Reputation: vb5prgrmr will become famous soon enough vb5prgrmr will become famous soon enough 
Solved Threads: 146
vb5prgrmr vb5prgrmr is online now Online
Practically a Posting Shark

Re: Media Player load in game

 
0
  #6
Mar 4th, 2009
If the API instructions are above your head, check out the MMC (Multimedia control). Right click on your toolbox, select components, scroll down and select the Microsoft Multimedia Control 6.0 (SP3). Once it is on your form press F1 for help and read all about it.

Good Luck
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 15
Reputation: venomocity is an unknown quantity at this point 
Solved Threads: 0
venomocity's Avatar
venomocity venomocity is offline Offline
Newbie Poster

Re: Media Player load in game

 
0
  #7
Mar 5th, 2009
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
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC