phaser
phaser copied to clipboard
Volume parameter for audioSprite frames.
As of right now, AudioSprite json data model follows tonistiigi's audiosprite data model format, where individual frame type:
{
start: number;
end: number;
loop?: boolean;
}
Could is support/recognize an additional 'volume' parameter like this?
{
start: number;
end: number;
loop?: boolean;
volume?: number;
}
Where volume is from range <0,1> and each sprite frame when played, would by default play at this volume (unless overridden on play). If not specified, it would play at (default of) 1.
references: https://newdocs.phaser.io/docs/3.60.0/Phaser.Loader.LoaderPlugin#audioSprite https://github.com/tonistiigi/audiosprite
I'll accept this as a small non-invasive PR, but won't add the feature directly myself.
I'll accept this as a small non-invasive PR, but won't add the feature directly myself.
Noted.
For now i just peak the additional attributes directly from scene's json cache. Will try to address this if i get the time.
We've taken the decision to recode the Phaser Audio system from scratch and replace the existing one. This will remove the division between Web Audio and HTML Audio (you'll be able to have both together), along with lots of other required features and API updates. Development work will start in Q2 2024. As a result, we are going to mothball all audio-related issues rather than try to monkey-patch solutions in.