Meadville Space Center

Project Apollo - NASSP => Sounds => Topic started by: eddievhfan1984 on March 09, 2013, 03:58:34 AM

Title: Concerning OrbiterSound 4.0
Post by: eddievhfan1984 on March 09, 2013, 03:58:34 AM
Since updating my version of OrbiterSound, I've found that changing the references in the VS Solution files don't result in a compilable solution. This may be due to 4.0 embracing a 3D sound engine; will require further investigation. I'll take a look at the manual and keep y'all updated. :)

EDIT: Here's the fix.

Under the Project Apollo source code folder, go to src_sys/soundlibrary.cpp. In the file, you'll find the OrbiterSound function calls (like StartVesselWave3). Delete the numbers at the end of the function calls—those are SDK version numbers which have now been deprecated in 4.0. Coupled with the change in include lines and linker options, that should do the trick. This will make the project as it currently stands 4.0 compatible. However, if we want to take advantage of the new 3D sound engine, we may have to do some recoding. Who knows?

NEW EDIT: The SoundOptionOnOff function now takes three arguments, not two. From the 4.0 SDK header file:
// SoundOptionOnOff
// -----------------
// With this function you can put ON/OFF every sound
// in OrbiterSound the same way SOUNDCONFIG.EXE does
// but in a temporary manner and only for your ship.
// (start soundconfig.exe to test the sound related to each option so you have an idea what it does)
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// !!!! SEE Sound/_CustomVesselSounds FOLDER                              !!!!
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// -----------
// MyID   : The number returned by ConnectToOrbiterSoundDLL
// Option : Keyword as defined below:
// PLAYCOUNTDOWNWHENTAKEOFF         // The countdown of Apollo 11 when you take-off
// PLAYWHENATTITUDEMODECHANGE      // Play "rotation" "linear" sound when you change mode
// PLAYGPWS                     // The GPWS sound
// PLAYMAINTHRUST               // Main thrust sound
// PLAYHOVERTHRUST               // The hover thrust sound
// PLAYATTITUDETHRUST            // The attitude thrust sound
// PLAYDOCKINGSOUND               // The docking sound and radio
// PLAYRADARBIP                  // The radar bip when near another vessel
// PLAYWINDAIRSPEED               // The wind airspeed when atmosphere
// PLAYDOCKLANDCLEARANCE         // The landing clearance
// PLAYLANDINGANDGROUNDSOUND      // Rolling, landing, speedbrake, crash sound
// PLAYCABINAIRCONDITIONING         // Play the air conditionning sound
// PLAYCABINRANDOMAMBIANCE         // Play the random pump and rumble sound
// PLAYWINDAMBIANCEWHENLANDED      // Play the wind sound when landed
// PLAYRADIOATC                  // Play the atc radio sound
// DISPLAYTIMER                  // Display the timer text when you take-off
// DISABLEAUTOPILOTWHENTIMEWARP      // The auto-disable of pilot if you time warp
// ALLOWRADIOBLACKOUT            // Allow the radio blackout when reentry
// MUTEORBITERSOUND               // Mute all the orbiter sound
// PLAYRETROTHRUST               // --- NEW OrbiterSound 4.0
// PLAYUSERTHRUST               // --- NEW OrbiterSound 4.0
// PLAYWINDCOCKPITOPEN            // --- NEW OrbiterSound 4.0 if TRUE play planet wind and base sound even in internal view.
// PLAYREENTRYAIRSPEED            // --- NEW OrbiterSound 4.0 the reentry sound, see demo scenario "reentry sound"
// Status:   TRUE if you want to allow the sound
//         FALSE if you want to disable it (sound stops immediately when you call it)
// ------
//  FALSE if the connection to orbitersound's dll failed
//  or the keyword used is false
// --------------------
//  SoundOptionOnOff(MyID,PLAYMAINTHRUST,FALSE)   // Disable the main thrust sound in orbitersound
//  SoundOptionOnOff(MyID,PLAYGPWS,TRUE)      // Enable the GPWS sound in OrbiterSound
BOOL SoundOptionOnOff(int MyID,int Option, BOOL Status=TRUE);
// ConnectToOrbiterSoundDLL
// -------------------------
// This must be called previous to any other OrbiterSound call
// You must call this in your "clbkPostCreation" (new version of "ovcPostCreation" which is now obsolete)
// You must keep in your class the ID it returns and provide it to all other functions.
// ----------
// Obj    : The Vessel handle using this : MySoundID=ConnectToOrbiterSoundDLL(GetHandle());
// return : An ID that you must keep and provide to others function (or -1 if it fails to connect).
int ConnectToOrbiterSoundDLL(OBJHANDLE Obj);

I suppose this allows for independent sound routing between each vehicle. Anyhoo, IDK if that's the job for me. But I would like to commit the edited references I have so far to CVS, for others to play with. Would that be OK?

Title: Re: Concerning OrbiterSound 4.0
Post by: rcflyinghokie on March 12, 2013, 12:02:16 PM
Forgive my naivety in asking this, but would this fix be able to run in both the 3.5 and 4.0 versions of orbitersound?  Or would an uninstall of 3.5 and install of 4.0 be required.

Title: Re: Concerning OrbiterSound 4.0
Post by: eddievhfan1984 on March 12, 2013, 06:01:35 PM
This is just for compiling the source code from the beginning. If you already have the compiled binaries from an earlier version, it'll work in either 3.5 or 4.0. But if we want to build with 4.0's features in mind, that might take some coding.