Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 10th, 2006, 6:49 PM   #1
Darcksky
Newbie
 
Join Date: May 2006
Posts: 18
Rep Power: 0 Darcksky is on a distinguished road
Insert Music to my Trainer

hey hi all , i wan to insert a sound to my trainer for solitaire i tried searching here but i gave up i couldn't find anything so i decided to post it here..

this is my problem i tried using the Microsoft Multimedia control and with this code:

Private Sub Form_Load()
MMControl1.FileName = App.Path & "\intro_sound.mp3"
MMControl1.Command = "Open"
MMControl1.Wait = True
MMControl1.Shareable = False
MMControl1.Command = "Play"
MMControl1.Command = "Close"
End Sub

but the problem is when i run the project i can hear the sound but it interrups my application like the sound has to stop for me to use my application
and i dont like that i want the sound to be playing while im using my application i also dont like to have the music in the project or the people who are going to use it have to download the music too is there a better way to di it?
Darcksky is offline   Reply With Quote
Old Jul 10th, 2006, 6:53 PM   #2
Booooze
Expert Programmer
 
Booooze's Avatar
 
Join Date: Mar 2006
Location: Igloo
Posts: 708
Rep Power: 3 Booooze is on a distinguished road
Send a message via MSN to Booooze
I've never used the multimedia control, only the windows media player control. You should be able to use the wmp control and not have any interuption problems. As for not having people download your music, you would either have to package it in a setup for file, or throw it in a resource file. Either way, the size of your file(s) will increase.
Booooze is offline   Reply With Quote
Old Jul 11th, 2006, 1:23 PM   #3
Darcksky
Newbie
 
Join Date: May 2006
Posts: 18
Rep Power: 0 Darcksky is on a distinguished road
how do i use the windows media player control or the wmp can you put the codes here and explain or anybody else plz.. google isnt helping..
Darcksky is offline   Reply With Quote
Old Jul 11th, 2006, 9:33 PM   #4
Booooze
Expert Programmer
 
Booooze's Avatar
 
Join Date: Mar 2006
Location: Igloo
Posts: 708
Rep Power: 3 Booooze is on a distinguished road
Send a message via MSN to Booooze
Here's some simple code:
wmp.URL = "C:\song.mp3" ' load song
wmp.Controls.play 'play the song

The control seems to have changed since the last time I used it. Newer version. That will play the song for you, but I can't find the code to get it to repeat.

There's seems to be an ok amount on google, but if your still having trouble, have you looked on msdn?
Booooze is offline   Reply With Quote
Old Jul 12th, 2006, 7:24 PM   #5
Darcksky
Newbie
 
Join Date: May 2006
Posts: 18
Rep Power: 0 Darcksky is on a distinguished road
Quote:
Originally Posted by Booooze
Here's some simple code:
wmp.URL = "C:\song.mp3" ' load song
wmp.Controls.play 'play the song

The control seems to have changed since the last time I used it. Newer version. That will play the song for you, but I can't find the code to get it to repeat.

There's seems to be an ok amount on google, but if your still having trouble, have you looked on msdn?
Well That's ok i dont need the song to repeat its a Flash music 23 sec mp3

my question is does that code plays like if my music song is in C:music.mp3 it will play it from there .. because its not just for me i want other people to listen to the music but the will not because they dont have the song in C"\ i want them to hear it . is there another way ???
Darcksky is offline   Reply With Quote
Old Jul 12th, 2006, 9:47 PM   #6
Booooze
Expert Programmer
 
Booooze's Avatar
 
Join Date: Mar 2006
Location: Igloo
Posts: 708
Rep Power: 3 Booooze is on a distinguished road
Send a message via MSN to Booooze
What you need to do is figure out how you are going to package your program. Are you going ot create a little setup program yourself? Are you going to just add the files to a zip file? or are you going to create an actual setup file (check out inno.com) using a third party program? The other way I mentioned before was to use a resource file. If you use a resource file, you can add the mp3 file to the exe, and extract it at runtime to a temp directory, and then play it. There are lots of options to do it. All you haev to do is figure out which option you are going with, then reconfigure the code to point to the right mp3 file. I have a tutorial on resource files if you would like it. It's how I learned it. I can email it to you if you woudl like.
Booooze is offline   Reply With Quote
Old Jul 13th, 2006, 2:49 PM   #7
Darcksky
Newbie
 
Join Date: May 2006
Posts: 18
Rep Power: 0 Darcksky is on a distinguished road
Quote:
Originally Posted by Booooze
What you need to do is figure out how you are going to package your program. Are you going ot create a little setup program yourself? Are you going to just add the files to a zip file? or are you going to create an actual setup file (check out inno.com) using a third party program? The other way I mentioned before was to use a resource file. If you use a resource file, you can add the mp3 file to the exe, and extract it at runtime to a temp directory, and then play it. There are lots of options to do it. All you haev to do is figure out which option you are going with, then reconfigure the code to point to the right mp3 file. I have a tutorial on resource files if you would like it. It's how I learned it. I can email it to you if you woudl like.
Can you explain to me the tutorial resource files my email is orlando_reategui@hotmail.com im making a huge program the Flash contains like 100 images with 100 timers and 100 codes with a mp3 sound and the program willl have mp3 too with some stuff in there but i just know how to put music with MMcontrol and Windows media control i need help so i think i need that resource files tutorial
Darcksky is offline   Reply With Quote
Old Jul 13th, 2006, 8:31 PM   #8
Booooze
Expert Programmer
 
Booooze's Avatar
 
Join Date: Mar 2006
Location: Igloo
Posts: 708
Rep Power: 3 Booooze is on a distinguished road
Send a message via MSN to Booooze
Quote:
Originally Posted by Darcksky
Can you explain to me the tutorial resource files my email is orlando_reategui@hotmail.com im making a huge program the Flash contains like 100 images with 100 timers and 100 codes with a mp3 sound and the program willl have mp3 too with some stuff in there but i just know how to put music with MMcontrol and Windows media control i need help so i think i need that resource files tutorial
whoa, in that case, you are not going to want to use a resource file. You will be better off using an installer. Check out Inno.

http://www.jrsoftware.org/isinfo.php
Booooze is offline   Reply With Quote
Old Jul 13th, 2006, 8:50 PM   #9
Darcksky
Newbie
 
Join Date: May 2006
Posts: 18
Rep Power: 0 Darcksky is on a distinguished road
Hey tHanks for that website but you didnt told me the proble of the music yet
like you just told me this code:
Quote:
wmp.URL = "C:\song.mp3" ' load song
wmp.Controls.play 'play the song
you said you are not sure if it works or not whatever.. i dont know what taht installer will do but in the folder where the application will go i just want the application .. but the music how to put it in the program you didnt tell me yet what's that use a resource file tutorial can you give it to me plz
Darcksky is offline   Reply With Quote
Old Jul 13th, 2006, 10:23 PM   #10
Booooze
Expert Programmer
 
Booooze's Avatar
 
Join Date: Mar 2006
Location: Igloo
Posts: 708
Rep Power: 3 Booooze is on a distinguished road
Send a message via MSN to Booooze
Quote:
Originally Posted by Darcksky
Hey tHanks for that website but you didnt told me the proble of the music yet
like you just told me this code:


you said you are not sure if it works or not whatever.. i dont know what taht installer will do but in the folder where the application will go i just want the application .. but the music how to put it in the program you didnt tell me yet what's that use a resource file tutorial can you give it to me plz
Well regardless of what you do, you must put the music somewhere. All the resource file will do is store the mp3 file in the program (within the exe). Then when you run the program, it will extract the music somewhere, and you can then use it. Ill send you the tutorial anyways though.

On a side note, if your program is very large, I highly recommend using that installer, At which point, you wouldnt need the resource file. Anyways, Giev it a go and see what you can do.

File's been sent. It includes a tutorial and an example project.
Booooze is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:14 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC