|
-
Oct 17th, 2008, 11:32 AM
#1
Thread Starter
New Member
[2008]Custom Sounds
Hey,
I wondered how I could play custom sounds, instead of systemsounds
I want the start to be key binded
Code:
If e.KeyCode = Keys.C Then ()
Could anyone help please?
Kind regards,
unknown666
-
Oct 17th, 2008, 11:33 AM
#2
-
Oct 17th, 2008, 12:36 PM
#3
Thread Starter
New Member
Re: [2008]Custom Sounds
 Originally Posted by kasracer
My.Computer.Audio.Play
It keeps saying the directory doesn't exist..
Code:
If e.KeyCode = Keys.V Then My.Computer.Audio.Play(Application.StartupPath & "\bin\clap.wav")
-
Oct 17th, 2008, 12:43 PM
#4
Re: [2008]Custom Sounds
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")
-
Oct 17th, 2008, 12:47 PM
#5
Re: [2008]Custom Sounds
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.
 Originally Posted by kleinma
Code:
My.Computer.Audio.Play(Application.StartupPath & "\clap.wav")
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.
-
Oct 17th, 2008, 01:03 PM
#6
Thread Starter
New Member
Re: [2008]Custom Sounds
 Originally Posted by kleinma
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")
Thanks! working now +rep
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|