Results 1 to 7 of 7

Thread: why wont this work??

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2002
    Posts
    50

    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'

  2. #2
    Fanatic Member joltremari's Avatar
    Join Date
    Sep 2000
    Location
    Mississippi
    Posts
    674
    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

  3. #3
    Lively Member
    Join Date
    Dec 2002
    Location
    Under the Boardwalk
    Posts
    79
    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
    -=]{ i ( ( er =-

  4. #4

    Thread Starter
    Member
    Join Date
    Dec 2002
    Posts
    50
    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

  5. #5
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    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:
    1. MediaPlayer1.FileName = App.Path & "\13-system_of_a_down-ego_brain-rns.mp3"

  6. #6
    Frenzied Member Shawn N's Avatar
    Join Date
    Dec 2001
    Location
    Houston
    Posts
    1,631
    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.

  7. #7
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    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
  •  



Click Here to Expand Forum to Full Width