Sound & Classes 
Author Message
 Sound & Classes

I am currently make a top-down car game in vb, I have a couple questions:

1. How can I make the engine sound (ie reving up the engine; speeding up)
proportional to acceration.  Currently i am using a WinAPI function that i
can make "beeps" at different frequencies except that it comes out the
system speaker not on the sound card.  Is there a function or something of
the sort to create sounds at different frequencies?

2. I am using class modules, how do I create the constructor for that
specific class?

Any help, tips , tutorials, or sample code would be greatly appreciated

-Flav



Fri, 17 Sep 2004 01:47:42 GMT  
 Sound & Classes

Quote:
> 1. How can I make the engine sound (ie reving up the engine; speeding up)
> proportional to acceration.  Currently i am using a WinAPI function that i
> can make "beeps" at different frequencies except that it comes out the
> system speaker not on the sound card.  Is there a function or something of
> the sort to create sounds at different frequencies?

You could use DirectSound for this.  You could load a wave file for your
engine sound, then use DirectSoundSecondaryBuffer8.SetFrequency to control
the pitch of the engine.  There are many samples in the DX SDK that show you
how to load a sound.

Quote:
> 2. I am using class modules, how do I create the constructor for that
> specific class?

What specific class are you talking about?  Are you using Visual Basic 6?
There is a Class_Initialize method that gets called when your class object
is created.  Or, are you refering to VB.NET parameterized constructors?

--
Eric DeBrosse
http://www.blown.com/dx/
Microsoft Visual Basic DirectX MVP

The opinions expressed in this message are my own personal views and
do not reflect the official views of Microsoft Corporation. The MVP program
does not constitute employment or contractual obligation with Microsoft.



Fri, 17 Sep 2004 03:51:40 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. vb.net & sounds

2. Sound Card & CPU Detection in QBasic

3. Sound & Graphics in QB

4. keyboard & sounds

5. Audio Measurements using VB6 & sound card

6. Sound Recording Using Low Level Api & Compression

7. Sound & Image

8. Msgbox & sounds

9. recording & sampling sound in VB

10. Sounds & Picture files in a DLL

11. Sound record & play

12. Q: Playing sound & video files in VB4

 

 
Powered by phpBB® Forum Software