Question a sound will produce?

bizarius

New member
Joined
Feb 22, 2010
Messages
4
Programming Experience
Beginner
I want to know how method or way when click mouse and then release a sound will produce..fro example : I click to draw alphabet 'a' and then when i release mouse a sound 'a' will be produce...anybody know how i can get th solutions?
 
Make the sounds you want as .wav files, In mouseup event play them, you will need to add some logic for this part.
VB.NET:
Dim s As New SoundPlayer
s.SoundLocation = "yourwavfilepath.wav")
s.Load() : s.Play() : s.Dispose()
 
For a very simple solution, use the Console.Beep function. It will work in a Windows Forms app as well as in a Console app. It uses two arguments -- the first is the frequency, and the second is the duration. The duration is 1000 for one second. You can experiment with the frequency to get the exact tone you want. Example: Console.Beep(frequency, duration)

Console.Beep(600, 500) will generate a moderate sound for 1/2 second.

The following code sounds out a range of frequencies you can try out:

VB.NET:
		For x As Integer = 50 To 2001 Step 50
			Console.Beep(x, 500)
		Next
 
thanks soltaire

thanks a lot soltaire..i will try to used your method.
thanks a lot newguy..i will try to used your method.
 
Back
Top