Page 1 of 1

play sound1.wav from folder in startupup path

Posted: Thu Dec 30, 2010 4:17 am
by zachman61
well title says it all
this is the location it is in the startup folder

assets\sound1.wav
how can i play it
ive got this
Code: Select all
 My.Computer.Audio.Play(Application.StartupPath & "assets\sound1.wav")
also when i put in the full location
Code: Select all
C:\Users\Zachary\Desktop\PROJECTNAMEREMOVED\PROJECTNAMEREMOVED\PROJECTNAMEREMOVED\bin\Debug\assets\sound1.wav
it works fine

Re: play sound1.wav from folder in startupup path

Posted: Thu Dec 30, 2010 4:22 am
by Proprogrammer
also instead of using & you could use +, well either way works.

Re: play sound1.wav from folder in startupup path

Posted: Thu Dec 30, 2010 6:29 am
by CodenStuff
Hello zachman

You forgot a "\" backslash:
Code: Select all
My.Computer.Audio.Play(Application.StartupPath & "\assets\sound1.wav")

Re: play sound1.wav from folder in startupup path

Posted: Thu Dec 30, 2010 6:58 pm
by zachman61
ah thank you codenstuff :D Sir