|
-
Dec 23rd, 2002, 01:56 PM
#1
Thread Starter
Member
why wont this work??
[Highlight=VB]Private Sub Form_Load()
MediaPlayer1.FileName = "13-system_of_a_down-ego_brain-rns.mp3"
MediaPlayer1.Play
MediaPlayer1.Visible = False
End Sub[Highlight=VB]
whut i have done is i embeded my sound file into the application,
when u ran my program the 1st tyme it worked, why wont it work now>?
i keep getting this error" run time error' -2147467259
method'play'of object 'imediaplayer2 failed'
-
Dec 23rd, 2002, 02:00 PM
#2
Fanatic Member
You probably need a complete file path like:
"C:\SomeFolder\13-system_of_a_down-ego_brain-rns.mp3"
"I have not failed. I've just found 10,000 ways that won't work."
'Thomas Edison'
"If we knew what it was we were doing it wouldn't be called research, would it?"
'Albert Einstein'
VB6
-
Dec 23rd, 2002, 02:03 PM
#3
Lively Member
This is all i did
[Highlight=VB]
MediaPlayer1.FileName = "C:\My Documents\My Music\New Folder\sounds\your1021001527.mp3"
[\vBcode]
i just turned on autostart and it worked
-
Dec 23rd, 2002, 02:04 PM
#4
Thread Starter
Member
yeah, but i have to export my application, so i can't have it linked to a song on my computer, the song has to be embeded in with an OLE
-
Dec 23rd, 2002, 02:23 PM
#5
ummm well your not going to be able to embed the file into your exe with VB... but if you include it with your application then just reference it using app.path.. that will point to the path on the given computer where the exe resides... so if you include your mp3 with your application and put it in the same folder as your exe.. it would look something like this..
VB Code:
MediaPlayer1.FileName = App.Path & "\13-system_of_a_down-ego_brain-rns.mp3"
-
Dec 23rd, 2002, 03:36 PM
#6
Frenzied Member
Actually, you could embed the MP3 into your application as a resource. At run-time, you would extract the resource into a file and then just play it from there.
-
Dec 23rd, 2002, 03:52 PM
#7
luravex and killerSD: To display code in your posts do this (this won't be displayed as formatted code because I'm using a trick to make it not happen, but when you do it it will show up formatted.
[vbcode]
Dim strValue As String
strValue = "Example"
[/vbcode]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|