# XRSound Open-Source Development

#### martins

##### Orbiter Founder
Orbiter Founder
All done! XRSound is now in the main branch.

#### martins

##### Orbiter Founder
Orbiter Founder
There is one additional thing I could try if you are interested.

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. I could try to automate this step and integrate the irrKlang download/installation into the build process. This might also help with CI, which currently excludes the XRSound build from the test, because the required irrKlang libraries aren't present on the github CI server.

#### Ripley

##### Tutorial translator
Donator
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...
Sorry if I'm being a bit dumb here:
I hope the word "user" in this context is meant as "Git user", or as "developer".
I very much hope the end user (as in "common layman Orbinaut") will not need to have a full blown VS build environment to enjoy future Orbiter versions...

Last edited:

#### martins

##### Orbiter Founder
Orbiter Founder
You are correct. The required libraries will be included in the binary packages, so no need to download any additional libraries and no need to compile anything for end users. Sorry for the confusion.

#### Matias Saibene

##### Active member
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.

#### dbeachy1

Orbiter Contributor
Donator
Beta Tester
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.

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.

Last edited:

#### Matias Saibene

##### Active member
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.

Excellent! Thank you very much, now I am going to contact @Abdullah Radwan to see if he can modify the G42-200 to fit the latest changes so that the Starliner can have an excellent acceleration sound effect.

I want to create a configuration file for a GenericVehicle vessel, but it seems like it isn't identified by XRSound 2.0 for some reason. It doesn't even exist in the log file. Any ideas why is that? No issues with Orbiter Sound.

Also, is it possible to release XRSound 3.0 for Orbiter 2016? I need that for the playback speed and most importantly, to compile against the dynamic library. I think using Dynamic XRSound is kinda useless now with 3.0 being already dynamic. I will take it down as soon as 3.0 is published.

#### dbeachy1

Orbiter Contributor
Donator
Beta Tester
The 32-bit build of XRSound 3.0 should in theory work fine with Orbiter 2016, although I have not tested that. It will not be officially supported, however.

As for your question, what does "No issues with Orbiter Sound" mean? The configuration files for XRSound are entirely different from OrbiterSound's settings, and you can't interchange them. The XRSound User Manual details how to create a custom configuration file for a custom vessel on pages 11-13. You will also want to verify that your XRSound is installed correctly by verifying that custom sounds (such as gear down / up) work with the default DeltaGlider, since that is also handled via configuration files.

Last edited:

All of that works fine. Not only doesn't XRSound apply my configuration file to the GenericVehicle vessel, but it doesn't even create an instance for it in the log file (i.e. "XRSoundDLL::GetXRSoundEngineInstance: creating new XRSoundEngine instance for vessel" doesn't exist in the log file for the GenericVehicle vessel). Other vessels that don't have a configuration file do have an instance created for them, only GenericVehicle vessels are absent.

For Orbiter Sound, I know the configuration file is different and I read the manual of course, but what I meant was that Orbiter Sound works with GenericVehicle vessels, unlike XRSound.

#### dbeachy1

Orbiter Contributor
Donator
Beta Tester
If XRSound is not creating log entries in the log file for your custom vessel, make sure that you enabled verbose logging by updating the XRSound.cfg file as per step 1 on pages 11-12 of the XRSound User Manual. If you do that, the log will show details for all vessels in the scenario. This code has not changed since the initial XRSound release.

As for generic vessels, XRSound certainly does work with generic vessels via configuration files, as demonstrated by the default DeltaGlider, ShuttlePB, and the rest of the default Orbiter vessels. There is no special code in XRSound for those vessels -- they are handled entirely via custom configuration files (as are any other custom vessels) by following the steps detailed in the XRSound User Manual.

Last edited:

#### 80mileshigh

Donator
Last edited:

Yes, I meant GeneralVehicle, my bad!

I enabled verbose logging but it still doens't appear in the log:
Code:
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'

Attached below is the GeneralVehicle vessel. You need GeneralVehicle module above to be installed. You can find a scenario in Deepstar folder to test.

#### dbeachy1

Orbiter Contributor
Donator
Beta Tester
From what I can tell, these GenericVehicle vessels do not define any thrusters, and so XRSound by design ignores them since we don't want XRVessel sounds playing for UMMu astronaut "vessels", for example. (This is also why those vessels are not shown in the log file.) If you really want all the default vessel sounds to play for these vehicles, you can either define a dummy thruster for the vessel (such that pVessel->GetThrusterCount() returns > 0) or you can update the GeneralVehicle code to link with XRSound.lib and play only those sounds that make sense for these vehicles via code.

I will add another logging line in XRSound 3.0 to also log a line for intert (i.e., zero-thruster) vessels that are not eligible for default sounds in order to clear up confusion going forward.