Music
Music while a loading screen shows, faded in and out with it, and played on through the level load when its sound is set for it.
On this page
In a game on Direct3D 12, Windows 64-bit, Neo Async Loading Screen's own thread draws the loading screen while the engine loads (While the Engine Loads).
Set it in the Setup tab's 02 Content (the music and its volume), in Project Settings > Plugins > Neo Async Loading Screen > Look > Music and Music Volume, or in a recipe:
music { sound "/Game/Audio/S_LoadingLoop"; volume 0.6; fade 1s }What it does
- The music plays while a loading screen shows: it fades in when the screen appears and fades out when the screen starts to close. A screen that comes back during the fade out brings it back from where the fade is.
- Once started, the audio mixer plays it on its own thread: it plays on through the level load, garbage collections and blocks of the game thread when its sound loops, stays in memory and is PCM or ADPCM (below). Its fades are made by the mixer's thread too (a source effect added after the sound's own effects), so a fade goes on while the game thread is frozen.
- When a level change opens the screen, the music starts before the load freezes the game: the screen's start updates the audio and hands the new sound to the mixer until it plays, while the screen already covers the game. Without this, the engine would start the sound only at its next frame, after the whole load.
- It is a 2D sound of its own, never paused with the game and not stopped by the level change.
- Its asset loads asynchronously when the game starts and stays loaded. At the launch, the music starts after the first map loads, if the launch screen still shows: no asset can play before that.
- A screen the game shows (Show Loading Screen) starts the music at the next frame of the engine. If the game blocks in that same frame without a level load (a long function right after Show Loading Screen), the music starts when the block ends: show the screen one frame before the work.
A music that plays through the load
- Set the sound wave to loop, its Loading Behavior to Force Inline (kept in memory; a sound streamed from disk can stop while a load keeps the disk busy, HLP431) and its Compression Type to PCM or ADPCM (nothing to decode while it plays, HLP432).
- Name it in Project Settings or in a recipe of your project (
Config/, a recipe asset): the plugin adds it to the cook, with no cook setting (Recipes as assets; at cook time HLP022 when the cook does not ship it). A sound named only by a recipe made at run time is not cooked: reference it from a map, or add its folder to Project Settings > Packaging > Additional Asset Directories to Cook (HLP430 otherwise).Neo Loading Screen
The music uses the sound class and submix of its asset, and its source effect chain. A sound wave whose own effect chain does not support its channel count (more than two channels, most effects) keeps the engine's own fades, which hold their volume while the game thread is frozen.
The console variable Neo turns it off.
Something not as described? Every code the editor or the log shows has its own entry in Troubleshooting.