Referencing a file

Posts 1–15 of 17 · Page 1 of 2
Referencing a file
I want my application to play a mp3 file when it loads. I already added the mp3 to the application.



then i tried:

Code:
My.computer.audio.play("song.mp3")
and

Code:
IDKyet.my.computer.audio.play("song.mp3")
but neither want to work. any suggestions?
My.computer.audio.play(LOCATION.NAME, background)

Try this, with the location of the sound. D:
Quote Originally Posted by Asians View Post
My.computer.audio.play(LOCATION.NAME, background)

Try this, with the location of the sound. D:
i'm trying to avoid that? i dont want the music file separate from the application, which is why i included it?
Add music file to resources then add this code
Code:
My.Computer.Audio.Play(My.Resources.song, AudioPlayMode.Background)
Quote Originally Posted by Zoom View Post
Add music file to resources then add this code
Code:
My.Computer.Audio.Play(My.Resources.song, AudioPlayMode.Background)
add it to the resource? if that's not the same as adding it to the solution, im lost :P. and do i just drop the extension?
Here you go!


Add Audio then add that code i said!
Quote Originally Posted by Zoom View Post


Add Audio then add that code i said!
yeah, just figured it out a sec ago. thanks XD

*goddammit i should shoot myself*

Edit: "error: the wave headder is corrupt", does it not like .mp3 files?
Quote Originally Posted by gwentravolta View Post
yeah, just figured it out a sec ago. thanks XD

*goddammit i should shoot myself*

Edit: "error: the wave headder is corrupt"
What do you mean, Explain....
Quote Originally Posted by Zoom View Post
What do you mean, Explain....
here's a pic. and dont b hatin for the song, it's beast

Rename the file to a shorter name then edit he code...
Quote Originally Posted by Zoom View Post
Rename the file to a shorter name then edit he code...
renamed it to "boo" still didn't work. i think it just hates MP3 files
Quote Originally Posted by gwentravolta View Post
renamed it to "boo" still didn't work. i think it just hates MP3 files
Did you add the files as audio?

Quote Originally Posted by Zoom View Post
Did you add the files as audio?

yes massa... message too short
the only "audio" file it will accept is .wav. is there some "import" or something i can use to make it accept .mp3s?

edit: Ahhh sound of success. seems like only .wav works. fine w/ me, i have a converter
Quote Originally Posted by gwentravolta View Post
yes massa... message too short
the only "audio" file it will accept is .wav. is there some "import" or something i can use to make it accept .mp3s?
Easiest way, get a mp3 to waw converter.. Google it.

That code doesn´t accept mp3......Idk why.
If you want it to play when it loads, then either put it in a timer that's enabled, or put under Form1_Load
I would test this but my internet is about to go off...
If that's not what your talking about, then here:
Try using .mp4 or .wav
If I remember, I will post a tutorial on making a video converter when I get my internet back.
Posts 1–15 of 17 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

Need help?