All done! XRSound is now in the main branch.
Sorry if I'm being a bit dumb here:Currently the user is required to download and install the irrKlang libraries manually, and to specify the path to them to CMake in order to build the XRSound module...
An idea: the sound component should have a function of changing the frequency of the sound. I explain: in Orbiter 2010 the G42-200 Starliner when I accelerated the engine the sound of the engine became more acute indicating the acceleration.
I have not read the whole thread so it is possible that I repeat something already said.
// Sets the playback speed of the sound with the specified ID.
// Note: the sound must have already started playing via PlayWav for this to have any effect.
// Plays the sound at a higher or lower speed, increasing or decreasing its frequency, which makes it sound lower or higher.
// soundID: unique sound ID originally passed to LoadWav and PlayWav
// speed: factor of the speed increase or decrease; 2 is twice as fast, 0.5 is only half as fast. The default is 1.0.
//
// Returns true on success, false if sound ID is invalid or is not currently playing.
virtual bool SetPlaybackSpeed(const int soundID, const float speed = 1.0) = 0;
// Returns the playback speed of the sound with the specified ID.
// Note: the sound must have already started playing via PlayWav.
// soundID: unique sound ID originally passed to LoadWav and PlayWav
//
// Returns factor of the speed increase or decrease; 2 is twice as fast, 0.5 is only half as fast. The default is 1.0.
// Returns 0 if sound ID is invalid or is not currently playing.
virtual float GetPlaybackSpeed(const int soundID) = 0;
As it turns out, I just committed an enhancement last night for the upcoming XRSound 3.0 that adds six new sound modification calls, including these two:
Code:// Sets the playback speed of the sound with the specified ID. // Note: the sound must have already started playing via PlayWav for this to have any effect. // Plays the sound at a higher or lower speed, increasing or decreasing its frequency, which makes it sound lower or higher. // soundID: unique sound ID originally passed to LoadWav and PlayWav // speed: factor of the speed increase or decrease; 2 is twice as fast, 0.5 is only half as fast. The default is 1.0. // // Returns true on success, false if sound ID is invalid or is not currently playing. virtual bool SetPlaybackSpeed(const int soundID, const float speed = 1.0) = 0; // Returns the playback speed of the sound with the specified ID. // Note: the sound must have already started playing via PlayWav. // soundID: unique sound ID originally passed to LoadWav and PlayWav // // Returns factor of the speed increase or decrease; 2 is twice as fast, 0.5 is only half as fast. The default is 1.0. // Returns 0 if sound ID is invalid or is not currently playing. virtual float GetPlaybackSpeed(const int soundID) = 0;
EDIT:
To clarify, XRSound 3.0 is what is built and installed as part of the Orbiter core now.
As for generic vessels, XRSound certainly does work with generic vessels via configuration files, as demonstrated by the default DeltaGlider
09.20.2021 18:26:00.461 - Parsing config file 'XRSound\XRSound.cfg'
09.20.2021 18:26:00.461 - Successfully parsed configuration file 'XRSound\XRSound.cfg'
09.20.2021 18:26:20.136 - Parsing config file 'XRSound\XRSound.cfg'
09.20.2021 18:26:20.137 - Successfully parsed configuration file 'XRSound\XRSound.cfg'
09.20.2021 18:29:15.190 - XRSound 2.00 (Build Date: Jul 3 2020) terminating.
09.20.2021 18:29:16.051 - Parsing config file 'XRSound\XRSound.cfg'
09.20.2021 18:29:16.052 - Successfully parsed configuration file 'XRSound\XRSound.cfg'