Sign in to follow this  
Guest taku

C code for FSsound.dll

Recommended Posts

I'm trying to attatch sound to an gauge file. I have Daniel Steiner's FSsound.dll and readme files.However, the sample of that file is for gauge of FS98.There are several changes since FS98 and FS2002 gauge structure.So, would someone kindly enough to tell or show me how to attatch sound to FS2002 gauge with FSsound.dll.Thanks in advance and thanks for previous kindness who gave me correct answers to my past questions.

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

You might want to have a look at Dai Griffiths' gauge creation tutorial. I see that it has a sample for an FS2K multi-gauge with sounds.Doug Dawson

Share this post


Link to post
Share on other sites

Doug,Any idea as to where one can obtain Dai Griffiths' gauge creation tutorial? I assume it is based on newer dll's and XML running inFS2002/FS9.Thanks,George

Share this post


Link to post
Share on other sites

George,Search for sd2gau14.zip on flightsim.com. An older version, (sdgau12.zip) is available on simviation.com.This tutorial was last updated April 1, 2003, so does not cover fs9. Additionally, it does not cover XML in any way.Doug

Share this post


Link to post
Share on other sites

Doug,Thanks for feedback. I downloaded that package last week. As youindicated, it does not help with XML type gauges.But thanks for the answer.cheers,George

Share this post


Link to post
Share on other sites

Taku,You did not specify the type gauge you want to attach a sound to.Are you talking about an XML type gauge or a C compiled gauge?In either case, it is a rather drawn out explaination. To lengthlyto include in this type forum window. I might suggest being more specific. And take the time to "wade" through all the threads in on this topic (in this forum). But just a intro to what is required. I will not mention anything about gauges designed using a c compiler. But for a XML type gauge:The XML gauge contains what is known as a Key Identity such as"TOGGLE_AFTERBURNER", as seen in below fragment of code. Now as you notice, there is a lot of reverse polish notation shown in this code. The end result in this case is if certain conditions are meet, then a "some_sound_file_name.wav" that happens to have been created and assigned as the sound to play when the simulator senses the TOGGLE_AFTERBURNER4 entity is actived (by the XML gauge in this case). So. What you need is to know if the FSound.dll was created so that it would play the wav file that is assigned to TOGGLE_AFTERBURNER4.This is a very simplified first attempt explaination. Think of it this way. The person who created the FSound.dll which resides in the MODULES directory, had to assigne different sound files for different Simultor AirCraft Key Entities/Event IDs.So the FSound.dll might have twenty or more sound files it will cancall up depending which Aircraft Event (e.i. gear down, flap down,overspeed, whatever). And it is a dll that runs once the simulator is loaded, so it is waiting to get a simulator call to play a given sound.NOW FOR THE LITTLE PROBLEM AS YOU ARE AWARE. What you/I/others have to find out is just what wav files play what for each possible entry in the FSsound.dll. I don't have that answer.BUT, just for the heck of it. Lets say you had the XMLSound.gauin your GAUGE directory. Well the original XMLSound.gau has for sound files it can play based on the XML gauge file using the K:KEY_TOGGLE_AFTERBURNER1,2,3,4 ..........like you ses in my piece of code. So if your XML gauge's logic is set up to sense something,lets say when the aircraft exceeds MACH 1. Then the logic in that XML gauge file would trigger the K:KEY_TOGGLE_AFTERBURNER(X) part of the code, which then would call the XMLSound.gau ( a dll program) which then would select and play the one of the four choices of wav files that the XMLSound.gau knows about.------------------Fragement of XML code-------------------- (A:AIRSPEED MACH, MACHS) 1 > (G:Var2) 0 == && if{ 0 (>K:KEY_TOGGLE_AFTERBURNER4) 1 (>G:Var2) } (A:AIRSPEED MACH, MACHS) 1 < if{ 0 (>G:Var2) }--------------------end of code----------------------------So...........if you have followed me thus far. It will become obviouse hopefully that one must know which wav files a given sound generator type file such as FSsound.dll or XMLSound.gau (which is a dll), will lock for under the SOUND DIRECTORY and then play that particular sound file for a given event that is triggered within the XML gauge.I hope the above is not confusing you. Just want to give you a flavorfor what must be down to trigger a sound from a XML type gauge.The C type gauges must meet the same type criterea, but to talk about it here would be out of place, to much involved.Lastly, I am barely a "newbie", just started about a week ago, so I really know very little about XML gauge design etc. at this point.So I am not the one to be asking to many questions directly to. I mostprobably will not have a good/correct answer.And If you have not done so, I would suggest you download the Microsoft Games.........FS2002 Panel_Design SDK tool kit for starters, if you do not have it. The one major document in it talks a little about XML type gauges.hang in there,George

Share this post


Link to post
Share on other sites

Thanks all for answers.Actually, Dai Griffiths' gauge creation tutorial is very helpful for me and there are many samples included in it. Now I understand how to write source code of the gauges with sound. Thanks.>grbsorry, I was finding about C source sample for FSSound.By the way, I have trouble with compiling the gauge.This was happen since I'm using FSSound function in my source.Error messages are;Sample.obj : error LNK2001 unresolved external symbol _main_cb@12Sample.obj : error LNK2001 unresolved external symbol _RegisterFileSample.obj : error LNK2001 unresolved external symbol _PlaySample.obj : error LNK2001 unresolved external symbol _UnregisterI know that the error was caused around from my FSSound settings, however I put the line#include "FSSound.h" correctly on Sample.C. Also I put FSSound.h in same folder as other files. Do you think am I need any other settings other than that?

Share this post


Link to post
Share on other sites

Finally I sucessed to make a sound by gauge with FSSound.My trouble was caused by wrong settings in "makefile" file.It was solved by putting LIBS = user32.lib FSSound_msvc.libline in the file. Thank you for further advices.

Share this post


Link to post
Share on other sites

Warning:You should note that if your gauge uses FSSound.dll, FS2002 or FS2004 will not load it unless you declare FSSound.dll as an old module in the FS configuration file (fs2002.cfg or FS9.cfg). I guess you have already done so, but think about writing this in your gauge documentation if you plan to release it.I hav eexperienced this with my Airbus panels. I wrote it in the documentation and in the FAQ, but I had tons of e-mails from people who couldn't load the Airbus gauge in FS because of this. Many people don't even read the doc and send questions by e-mail, this is a pain in the ...;-)Eric

Share this post


Link to post
Share on other sites

I'd suggest that you guys take a look at the PlaySound sample in the DirectX SDK and forget about FSound.dll forever. The sample contains everything you need to play sounds in C/C++ gauges, even the code to load wave files.Just make sure that you add dxerr9.lib and dsound9.lib (for DX9) to your LIBS line. Once you got that to work, you might want to check out the PlaySound3D sample for more sophisticated effects.

Share this post


Link to post
Share on other sites

That's exactly what I plan to do for my future panels. I thank the author of FSSound for the help it has provided since now, but it is now too old to be used easily in the recent versions of FS. In addition, FSSound plays the sounds even if FS is iconized or in the background.Eric

Share this post


Link to post
Share on other sites

Hello Everybody,Just a thought would it be possible to create a module dll which plays sounds which is sent as a parameter from xml a file ? The functionality that we all are missing :-) I know of the xml sound gauge. BrgdsEugen

Share this post


Link to post
Share on other sites

Dear Rocky and HansThank you for your very useful comments and suggestions. Since I'm relatively new to create gauges, I have no plans to release any gauges so far.This is my practicing. My first release will be quite later. I'll try Playsound of DirectX.By the way, I'm planning to create a panel just as Rocky's great A3xx series with FMS. (Of course aircraft is not Airbus.) Please help for my further questions on this Forum.Regards

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