AudioSystemExt

AudioSystemExt is an enhanced system over Cyberpunk's AudioSystem.

This system exposes both the exact same API as its counterpart, but also similar methods with additional parameters.

For example, if you want your audio to fade-in linearly during 5secs:

  Redscript
import Audioware.LinearTween

//                                      ⬇️ notice 'Ext' extension here
let system = GameInstance.GetAudioSystemExt(game);
let v = GetPlayer(game).GetEntityID();

// play audio                            ⬇️ with 5s linear fade-in
system.Play(n"my_custom_audio", v, n"V", LinearTween.Immediate(5.));

// later on, stop audio                  ⬇️ with 2s linear fade-out
system.Stop(n"my_custom_audio", v, n"V", LinearTween.Immediate(2.));

Warning

Note that any of these additional parameters only work with audio defined in Audioware.

e.g. you cannot use a fade-in tween with non-reexported vanilla audio, see below.

Tip

If you want to use vanilla audio with Audioware, you can still convert + export them from WolvenKit as described in their Wiki, then re-define them normally in your manifest.

⚠️ make sure to use a supported audio format

YouTube demo

Going further

Combined with Codeware, you can e.g. quickly create atmosphere like so:

  Redscript
let weather = GameInstance.GetWeatherSystem(game);
weather.SetWeather(n"24h_weather_rain", 20.0, 9u);
GameInstance.GetAudioSystemExt(game).Play(n"milles_feuilles");

YouTube demo