Open Article19 opened 4 years ago
pauseAll()
suspends the WebAudio audio context, so the browser stops whatever processing it normally does for the context.
Understood. As an accompanying concern, are any of the built-in PIXI tickers being used? We often fiddle with the FPS of some of these, and completely stop others. Haven't run into any issues with sound yet, but wouldn't want to find something out the hard way. In our experience, high ticker rates results in more cpu use.
Each playing audio instance will attach a listener to Ticker.shared
for an update method. Reducing the fps of that ticker will have two effects:
"progress"
events it emits (one per tick, if the sound is playing). That said, the actual cpu usage of the update method depends on the number of sounds playing and due to the small amount of basic math should pale in the comparison to usage due to rendering.
I believe I’m noticing different amounts of energy use (as measured by the Activity Monitor in OSX) in different scenarios. In particular, when I pause a game (stop all rendering and tickers) if I issue a PIXI.sound.pauseAll() I see a MUCH lower average energy impact than if I only pause the 1 or 2 sounds that are playing at that moment. Is there some background process running that pauseAll interrupts?