Generating tones? 
Author Message
 Generating tones?

I would like to make a couple of simple beep tones in my VB application,
but not the default Beep function.
I would like a higher pitched beep, and a lower pitched beep,
so I can play them one after the other.  I thought that would be a pleasing
sound combination, informing the user of an action completed in the
So, my problem is: how do I make sounds other then Beep?

I appreciate any help on this...

-- Paul

Mon, 23 Jun 1997 04:35:19 GMT  
 Generating tones?
You need to play around with the following API calls located in the

Declare Function OpenSound Lib "SOUND.DRV" () As Integer
Declare Sub CloseSound Lib "SOUND.DRV" ()
Declare Sub SetVoiceNote Lib "SOUND.DRV" (ByVal Voice%, ByVal Note%, ...
                                          ... ByVal Length%, ByVal Dots%)

Declare Sub StartSound Lib "SOUND.DRV" ()

... then try some of this code to make a noise:

Sub Annoying_Sounds ()

        Voices = OpenSound()
        For I = 1 to 10
                SetVoiceNote 1, 40, 16, 0
                SetVoiceNote 1, 91, 16, 0
                SetVoiceNote 1, 140, 16, 0
                SetVoiceNote 1, 237, 16, 0

End Sub

Play around with the numbers and see what you come up with.

(Hint: if you send a longer series of noisemaking commands, the CloseSound
call shuts your sound driver up)

There are a few more API calls to get the routines which let you pass
octaves, notes, pitches, etc which I can post if you need them.  The demo
code will need to be a bit longer though.

Duncan S. Smith              I                       D M G I

"Bone Daddy At Work"         I

Mon, 23 Jun 1997 16:44:36 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Q: How to generate tones in VB6

2. Need to generate tones through PC speaker in VB4

3. Generating tones with VB/Win 3.0

4. New to DirectX -- Need to generate tones in VB.NET

5. Help! How to generate tone??

6. VB and midi - Anybody recommend a good third party component for generating tones & timbres?

7. Generating MIDI tones

8. How to generate DTMF tones

9. Wanting to generate DTMF tone in VB4.0 and SoundBlaster

10. Dynamic generated DownDown, Buttons, Names generates errors

11. Dynamic generated DownDown, Buttons, Names generates errors

12. Generate random number (how to generate seed)


Powered by phpBB® Forum Software