September 21, 200718 yr Hi!I wanted to add a simple AP - disconnect sound to my gauge.So I was looking for a easy sound function and found the WinAPI function PlaySound.PlaySound("SOUNDcaapdis.wav", NULL, SND_FILENAME | SND_ASYNC | SND_NODEFAULT);This function works fine in the gauge.But I was wondering why nobody uses this function although it is so easy to use. So, is there a problem with this function is connection to gauges and Flight Simulator?Regards,Harry
September 22, 200718 yr Moderator None that I'm aware of, although for AP disconnect it would have been simpler to modify your sound.cfg file:[AP_DISENGAGE_SOUND]filename=ccapdiscmaximum_volume=10000 Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
September 22, 200718 yr At one time there was a problem using Playsound with certain sound cards (SoundBlaster) but I don't know if that still applies to current hardware.Fred
September 22, 200718 yr Hi!Thanks for your answers.So Playsound seems to be OK. I'm really wondering why things like fssound.dll were used so often if the way is that easy.@Bill: The AP is a generic gauge, so it should play the sound itself without the help of a sound.cfgOtherwise yourapproach would be the easiest.Harry
September 22, 200718 yr If you need to do more than a simple one-shot sound effect, for example looping a sound, or having a sound depend on a variable such as engine rpm, you need more than this function.
September 22, 200718 yr Moderator >If you need to do more than a simple one-shot sound effect,>for example looping a sound, or having a sound depend on a>variable such as engine rpm, you need more than this>function.Well, that's not precisely correct, Patrick!To play an gyrosound that loops we could write:PlaySound("gyro.wav", NULL, SND_FILENAME | SND_ASYNC | SND_LOOP);Only one sound can play at once so if you play another sound before the first is finished it will be cut off. You can also stop a sound playing by passing NULL as the pszSound parameter.That last is the real problem with PlaySound: only one sound can play at once! Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
September 22, 200718 yr Fred, I think you're correct that there is still an issue with PlaySound and Vista drivers for some SoundCards. Not sure that this has been resolved. I can't get PlaySound to work on a 680i MB (on-board sound) in Vista..but it works fine on the XP partition (same PC)RegardsJim
Create an account or sign in to comment