phaser icon indicating copy to clipboard operation
phaser copied to clipboard

Volume parameter for audioSprite frames.

Open michalfialadev opened this issue 2 years ago • 2 comments

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

michalfialadev avatar Jun 14 '23 11:06 michalfialadev

I'll accept this as a small non-invasive PR, but won't add the feature directly myself.

photonstorm avatar Jun 14 '23 11:06 photonstorm

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.

michalfialadev avatar Jun 14 '23 12:06 michalfialadev

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.

photonstorm avatar Feb 20 '24 15:02 photonstorm