![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: May 2006
Posts: 18
Rep Power: 0
![]() |
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? |
|
|
|
|
|
#2 |
|
Expert Programmer
|
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.
|
|
|
|
|
|
#3 |
|
Newbie
Join Date: May 2006
Posts: 18
Rep Power: 0
![]() |
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..
![]() |
|
|
|
|
|
#4 |
|
Expert Programmer
|
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? |
|
|
|
|
|
#5 | |
|
Newbie
Join Date: May 2006
Posts: 18
Rep Power: 0
![]() |
Quote:
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 ??? |
|
|
|
|
|
|
#6 |
|
Expert Programmer
|
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.
|
|
|
|
|
|
#7 |
|
Newbie
Join Date: May 2006
Posts: 18
Rep Power: 0
![]() |
Yea i have figured out some friend told me but is there a way to Play mp3 too because i convert it to wav and i was 6mb now the music is 32MB and my project is 40mb it was like 2mb is there a way ??
|
|
|
|
|
|
#8 |
|
Expert Programmer
|
Like I said, if it's an MP3, and it's a windows program, just use windows media player control. Give it another shot. Your making more work for yourself.
|
|
|
|
|
|
#9 |
|
Newbie
Join Date: May 2006
Posts: 18
Rep Power: 0
![]() |
Can you give me the Code for Windows media Control Mixed with Resource ??
Cause 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 interrupts my program How should i do it? |
|
|
|
|
|
#10 |
|
Newbie
Join Date: May 2006
Posts: 18
Rep Power: 0
![]() |
Can you give me the Code for Windows media Control Mixed with Resource ??
Cause 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 interrupts my program How should i do it? |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|