sound
sound copied to clipboard
feature request: channel
it common for a game to manage sounds in multi channels, for example, BGM and SE. and may need to use batch method like volumeAll, muteAll for a channel.
Was thinking about introduce the idea of "groups" as a new feature. This would bucket a bunch of sounds to provide more convenient way to pause/resume/mute/volume sounds that are similar.
I made a wrapper of sound instances with "tags" system right for that purpose. So i can make unique names, apply various volume modificators for one or more instances with tag, pause groups, etc. Will be great to see that kind of functionality right in the library, it's really useful.
Was there any further developments with Groups? Are we able to create more than one SoundLibrary to manage groups of sound?
Thanks in advance
I use tags in my audio works as well. When uploading assets, send channels to audio files.
private _sounds: { [soundId:string]: PIXI.SOUND.default.Sound & { channel: string } };
private _sfxMute: boolean;
for(const sfx in this._sounds) {
if(this_sounds[sfx].channel = "sfx")
this._sounds[sfx].muted = true;
}
Are the groups / channels still planned or whether the idea has been dropped?
I still think it's a great feature to add. I'd welcome a PR if someone feels passionate about this to add.