Jump to content

I set it up to loop music the whole time. But when i gave the exe to my friend he got this error. Does anyone know how to fix it? 

 

http://puu.sh/c6j9D/87da56b55a.png

 

this is the code

 

private void oNToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Player.SoundLocation = @"C:\Users\*****\Downloads\Sound.wav";
            this.Player.PlayLooping();
        }
 
        private void oFFToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Player.Stop();
        }

 

I think it is probably to do with the location of the file. So how do i give him the sound file too or something.

Link to comment
https://linustechtips.com/topic/230441-c-windows-form-application/
Share on other sites

Link to post
Share on other sites

You either have to include the sound file with the .exe or get him to download it separately. It can't be played if it doesn't exist on his comp

My Current Build: 

Intel i5 3570K @ 4.4GHz 1.11V, Cooler Master Hyper 212 EVO, Asrock Z77 Extreme4, Corsair Vengeance 8GB 1600MHz, Samsung 840 EVO 250GB, Asus GTX 760 DCII Overclocked, Corsair CX600M

Link to post
Share on other sites

i would recommend you pack the audio file in with the exe. also, for directory location, use "./<file name>" "./" means current working directory, so no matter where the program is located, the audio is expected to be right next to the program.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×