XRSound Open-Source Development

martins

Orbiter Founder
Orbiter Founder
Joined
Mar 31, 2008
Messages
2,448
Reaction score
462
Points
83
Website
orbit.medphys.ucl.ac.uk
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
Joined
Sep 12, 2010
Messages
3,133
Reaction score
407
Points
123
Location
Rome
Website
www.tuttovola.org
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:

Matias Saibene

Development hell
Joined
Jul 7, 2012
Messages
1,033
Reaction score
596
Points
128
Location
Monte Hermoso - Argentina
Website
de-todo-un-poco-computacion-e-ideas.blogspot.com.ar
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

O-F Administrator
Administrator
Orbiter Contributor
Addon Developer
Donator
Beta Tester
Joined
Jan 14, 2008
Messages
9,214
Reaction score
1,560
Points
203
Location
VA
Website
alteaaerospace.com
Preferred Pronouns
he/him
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

Development hell
Joined
Jul 7, 2012
Messages
1,033
Reaction score
596
Points
128
Location
Monte Hermoso - Argentina
Website
de-todo-un-poco-computacion-e-ideas.blogspot.com.ar
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.
:cheers:(y)
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.
 

Abdullah Radwan

Addon Developer
Addon Developer
Joined
Aug 20, 2017
Messages
314
Reaction score
284
Points
78
Location
Cairo
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

O-F Administrator
Administrator
Orbiter Contributor
Addon Developer
Donator
Beta Tester
Joined
Jan 14, 2008
Messages
9,214
Reaction score
1,560
Points
203
Location
VA
Website
alteaaerospace.com
Preferred Pronouns
he/him
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:

Abdullah Radwan

Addon Developer
Addon Developer
Joined
Aug 20, 2017
Messages
314
Reaction score
284
Points
78
Location
Cairo
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

O-F Administrator
Administrator
Orbiter Contributor
Addon Developer
Donator
Beta Tester
Joined
Jan 14, 2008
Messages
9,214
Reaction score
1,560
Points
203
Location
VA
Website
alteaaerospace.com
Preferred Pronouns
he/him
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

Addon Developer
Addon Developer
Donator
Joined
Feb 18, 2008
Messages
365
Reaction score
258
Points
63
Location
Melbourne
Website
eightymileshigh.wordpress.com
Last edited:

Abdullah Radwan

Addon Developer
Addon Developer
Joined
Aug 20, 2017
Messages
314
Reaction score
284
Points
78
Location
Cairo
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

O-F Administrator
Administrator
Orbiter Contributor
Addon Developer
Donator
Beta Tester
Joined
Jan 14, 2008
Messages
9,214
Reaction score
1,560
Points
203
Location
VA
Website
alteaaerospace.com
Preferred Pronouns
he/him
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.
 

Abdullah Radwan

Addon Developer
Addon Developer
Joined
Aug 20, 2017
Messages
314
Reaction score
284
Points
78
Location
Cairo
I can confirm the issue was solved by adding "MaxMainThrust = 0 " to the vessel configuration file. Thank you!

A message in the log for inert vessels would definitely be helpful.
 
Top