Im looking to play a sound from a folder which is in my debug directory.

I got this working for a PictureBox:

PictureBox1.ImageLocation() = ("Resources\picture.png")

But I cant find something to play a sound. This is what I had before:

My.Computer.Audio.Play("C:\Users\......\Sounds\beep-2.wav")

I dont really want to be writing the location of the files using special directories. Is there any way I can just set the location of the file to the directory in which the .exe is.

Edited 5 Years Ago by BleepyE: n/a

Nah I get this error when trying the following code
Conversion from string "Beep-2" to type 'Integer' is not valid.

My.Computer.Audio.Play(Application.StartupPath("Beep-2"))

Change with this :

My.Computer.Audio.Play(Application.StartupPath & "\beep-2.wav")

Edited 5 Years Ago by Jx_Man: n/a

Ahh ofcourse. The problem I have is that I tried just to use to full location of the sound file, but no sound played.

Now using this method the sound also doesnt play, but im listenning to music etc.

Ive also had a problem with resources, non of pictureboxes will occupy an image in my resources.

Im not sure if this is a linked problem. But im going to reboot my maching and try again.

Are your files are in debug folders when you build ur application?
in debug mode can u check?

Yes they were, and its working now. Just needed a reboot.
Thanks

This question has already been answered. Start a new discussion instead.