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: 710
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: 710
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: 710
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 28th, 2006, 10:05 PM   #7
Darcksky
Newbie
 
Join Date: May 2006
Posts: 18
Rep Power: 0 Darcksky is on a distinguished road
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 ??
Darcksky is offline   Reply With Quote
Old Jul 28th, 2006, 11:47 PM   #8
Booooze
Expert Programmer
 
Booooze's Avatar
 
Join Date: Mar 2006
Location: Igloo
Posts: 710
Rep Power: 3 Booooze is on a distinguished road
Send a message via MSN to Booooze
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.
Booooze is offline   Reply With Quote
Old Jul 29th, 2006, 6:13 PM   #9
Darcksky
Newbie
 
Join Date: May 2006
Posts: 18
Rep Power: 0 Darcksky is on a distinguished road
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?
Darcksky is offline   Reply With Quote
Old Jul 29th, 2006, 6:16 PM   #10
Darcksky
Newbie
 
Join Date: May 2006
Posts: 18
Rep Power: 0 Darcksky is on a distinguished road
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?
Darcksky 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 7:28 AM.

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