Continuing from here.
Below is what i almost posted, then had a second though, as usual…
Now i think that the functionality i wanted just does not exist in CGE ATM
Doc: “This is useful if you simply want to disable any sound output”
This sounds misleadingly encouraging. Consider this:
D:\DelphiProjects\Libs\Games\castle-engine\src\audio\castlesoundengine_engine.inc
Line 400
property Device: string read FDevice write SetDevice;
{ Enable sound.
If set @false before your fist call to @TCastlePlayingSound.Play, then @ContextOpen will not initialize any audio device, provided by the platform(operating system).
This is useful if you simply want to disable any sound output
(or backend, like OpenAL, usage), even when sound library (like OpenAL)
is available.
If the sound context was already initialized when setting this property to False,
we will eventually close it and might also release the audio device for other applications to use (this depends upon the used back-end implementation details). More precisely, we will
call @ContextClose here, and then call @ContextOpen again if you set the property back to @True.
This might also cause an audible "click" in headphones, depending upon used back-end and platform. This would also reset all the memory data buffers of all the playing streams and make CGE forget the current positions in sound loops.
In other words, `SoundEngine.Enabled := false` is not a way to temporarily mute the application, it is similar to pressing "Stop" button on a music player, rather than "Pause" button. For a short-term pausing consider setting @Volume to zero.
}
property Enabled: boolean read FEnabled write SetEnabled default DefaultEnabled;
Line 388
{ Sound volume, affects all sounds (effects and music).
This must always be within 0..1 range.
This property (unlike @Enabled) might be used for temporarily muting your application: setting it to 0.0 means that there would be no audible effects, and the sound backends (OpenAL, FMOD etc.) should be optimized for this specific case. }
property Volume: Single read FVolume write SetVolume
NOW the question: would it really be an equivalent of “pause button” ? My gut feeling is that all the looped sound sources would still be doing their loops, and all non-looped ones would run to theend and expire.
To my specific need it does not matter. To a usual game it would not matter too - the scene changed and so should be sound.
However, is there really a “pause” functionality in CGE, that “stops the time” in audio domain?
Probably not, and the wording above, i concocted i patched together from your explanations, are probably wrong.
No, i am on a fence if a global “audio pause” functionality is really needed for CGE.
On one hand, having an option is alway more freedom than not.
On another - it seems few would practically need it.
Then, what about fading? may CGE (on both global Sound Engine and local Sound Sources) levels have an out of the box “slow stop” and “slow resume” ? Again, it is not core functionality but off a nice-to-have shelf.