Hey,
I wondered how I could play custom sounds, instead of systemsounds
I want the start to be key binded
Could anyone help please?Code:If e.KeyCode = Keys.C Then ()
Kind regards,
unknown666
Printable View
Hey,
I wondered how I could play custom sounds, instead of systemsounds
I want the start to be key binded
Could anyone help please?Code:If e.KeyCode = Keys.C Then ()
Kind regards,
unknown666
My.Computer.Audio.Play
It keeps saying the directory doesn't exist..Quote:
Originally Posted by kasracer
Code:If e.KeyCode = Keys.V Then My.Computer.Audio.Play(Application.StartupPath & "\bin\clap.wav")
usually the exe is IN the bin folder, so that is where application.startuppath is going to point to.
If your wav is in the same folder as the exe, then you should do
Code:My.Computer.Audio.Play(Application.StartupPath & "\clap.wav")
Also, make sure you're including the wave file in the project but having it set to be copied on build. This way you ensure that if you do a rebuild (which cleans the last build), you won't lose your audio.Remove the slash and you're good to go. The slash should take you back to the root directory (so C:\) I believe. Regardless it's unnecessary when the executable is in the same folder as the audio.Quote:
Originally Posted by kleinma
Thanks! working now +repQuote:
Originally Posted by kleinma