August 11, 200619 yr 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
August 12, 200619 yr 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
August 12, 200619 yr Moderator 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
August 12, 200619 yr 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.
August 12, 200619 yr I am not using the VC++ envionment, but compiling using that which comes with Dev Studio 6.Any ideas?Rob
August 12, 200619 yr 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.
March 27, 200719 yr OK, eight months later I think I have it figured out...Enable "String Pooling" in the VS environment:http://forums.avsim.net/user_files/169227.jpgDoug
March 27, 200719 yr 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.
March 28, 200719 yr Moderator >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
Create an account or sign in to comment