Sign in to follow this  
Guest adameke777

First attempt at sound gauge

Recommended Posts

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 }; PANEL_SERVICE_PRE_INSTALL:if (InitDirectSound()==S_OK) { LoadWaveFile( 0 , "Soundwind_general.wav" ); } 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
Help AVSIM continue to serve you!
Please donate today!

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