Jump to content
Sign in to follow this  
Guest adameke777

First attempt at sound gauge

Recommended Posts

Guest adameke777

I'm trying to produce a gradually changing gear wind sound using Jose Oliveira's code ( DxSound ). Here are the code snippets.MODULE_VAR airspeed = { AIRSPEED };MODULE_VAR gearhndpos = { GEAR_HANDLE_POS };...case PANEL_SERVICE_PRE_INSTALL:if (InitDirectSound()==S_OK) { LoadWaveFile( 0 , "Soundwind_general.wav" ); }...case PANEL_SERVICE_PRE_UPDATE:lookup_var(&airspeed);lookup_var(&gearhndpos);if (gearhndpos.var_value.n > 0) PlayBuffer( 0, 1 ); Eventually I plan to do something like this:if (gearhndpos.var_value.n > 0) { ChangeVolume( 0, some_function_of_airspeed ); PlayBuffer( 0, 0 ); }Eventually, because as of now no sound is played. Where should I start debugging ? Is there a way to include the wav file as a resource ? BTW, right now I have ZERO resources in this:MAKE_STATIC ( gws_static, NULL, NULL, NULL, IMAGE_USE_TRANSPARENCY, 0, 0,0 )Also, I keep getting compilation error about no type definition in this line of fs9gauges.htypedef (*GAUGE_KEY_EVENT_HANDLER) (ID32 event, UINT32 evdata, PVOID userdata);I changed it to :typedef void (*GAUGE_KEY_EVENT_HANDLER) (ID32 event, UINT32 evdata, PVOID userdata);but I'm not sure wheather this is correct (it doesn't make a difference in this gauge).

Share this post


Link to post
Share on other sites
Guest adameke777

Disregard, I got it to work.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...