How to play tones of defined pitch, volume and duration?
Posted on 2004-03-30
How do I make a sound card produce some sounds that are not saved to a file ( WAV, MIDI, etc.), but generated at runtime.
If I'm not mistaking, Quick Basic had a function called: Sound ( pitch, duration ) which could generate a sound of defined pitch ( in Hz ) and duration ( in miliseconds i think )
Off course, the sound was played on PC speaker.
So following routine:
duration = 10
For x = 100 To 2000
would have produced a sound whoose pitch was higher every 10 miliseconds.
I would like to have the same thing in Visual Basic, but played on Sound Card, and with the ability to define volume of the sound.
How do I do that?