Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Option for sound context [auto|re]initialization #33

Closed
cursedcoder opened this issue Aug 30, 2017 · 2 comments
Closed

RFC: Option for sound context [auto|re]initialization #33

cursedcoder opened this issue Aug 30, 2017 · 2 comments

Comments

@cursedcoder
Copy link
Member

Status

At the moment sound context is always automatically created within SoundLibrary

Why it is not good

When context is created it is bound with sound hardware, so it always consumes resources.

There may be situations when hardware is blocked at the moment SoundLibrary being created.

My personal real cases:

  • On iOS cordova background plugin will rebind audio sources when used, this will always halt existing audio contexts.
  • Opening page with just pixi-sound included produces "soft noise" – when empty sound is streamed to audio output.

Proposal

  1. Add option autoInitialize – self-explanatory.
  2. Add interface SoundLibrary.rebuildContext() – or similar, this will provide users ability to recover from any hardware interruptions.
@bigtimebuddy
Copy link
Member

How about adding methods PIXI.sound.destroy() & PIXI.sound.init() so that the library can be re-initialized (i.e., recreate the sound context)?

@cursedcoder
Copy link
Member Author

@bigtimebuddy that's good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants