Jump to content
Sign in to follow this  
Guest Patrick_Waugh

Can't making looping sound stop

Recommended Posts

Guest FireChief

I am using the following code. The looping sound turns on just fine. But it won't shut off when the variable Alarm_pos is set to 0.switch(service_id){case PANEL_SERVICE_PRE_UPDATE:MGaugeSound = GetModuleHandle("GaugeSound");if (MGaugeSound == NULL) {MGaugeSound = LoadLibrary("GaugeSound");}GaugePlaySound = (TGaugePlaySound)GetProcAddress(MGaugeSound,"GaugePlaySound");GaugeStopSound = (TGaugeStopSound)GetProcAddress(MGaugeSound,"GaugeStopSound");TerminateSounds = (TTerminateSounds)GetProcAddress(MGaugeSound,"TerminateSounds"); if(Alarm_pos == 1) (GaugePlaySound)("SoundAlarm.wav","alarm",1); else (GaugeStopSound)("alarm");break;}Any help would be appreciated.Rob

Share this post


Link to post
Share on other sites

I was never able to get gaugesound.dll to work correctly in a Microsoft C++ environment. Had exactly the same problem you note.I gave up on it. Bought myself a DirectX textbook and started with this excellent example:http://library.avsim.net/esearch.php?DLID=...eira&CatID=rootThe only real downside is having to downlaod the rather massive DirectX SDK...Doug

Share this post


Link to post
Share on other sites

Like Doug said, it seems not to work in my MSVC++ .NET 2003 compiler either. Works just fine with the MinGW compiler of course.However, TerminateSounds works just fine. Unfortunately, it will stop ALL sounds currently being played with the GaugeSound.dll, but...


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Guest Patrick_Waugh

Yeah, instead use DxSound.zip, which you can find here on AVSIM I believe.It is very easy to use, and then you don't have to learn DirectSound. You just load sounds when the panel loads, then use them in callbacks, and then free buffers as the panel unloads.

Share this post


Link to post
Share on other sites
Guest FireChief

I am not using the VC++ envionment, but compiling using that which comes with Dev Studio 6.Any ideas?Rob

Share this post


Link to post
Share on other sites
Guest Patrick_Waugh

Isn't that an older compiler? Why not use the new one, especially since you can get a free version of it. Why make life harder than it has to be.

Share this post


Link to post
Share on other sites
Guest Patrick_Waugh

Nice find.Glad you didn't figure this out 2 years ago, or I wouldn't have forced myself to learn DirectSound, haha. =)Now I'm free to do whatever I want sound-wise.

Share this post


Link to post
Share on other sites

>OK, eight months later I think I have it figured out...>Enable "String Pooling" in the VS environment:Jesu, Maria, Guiseppe! I would NEVER have thought to look there...Great find! ;)Now I'm off to fix a bunch of gauges that need this... If I'm ever in your neck of the woods Doug, I own you at least a couple cases of your favorite beverage! :-beerchug


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

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...