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

Add support for different audio format #22

Closed
bigtimebuddy opened this issue Jul 18, 2017 · 3 comments
Closed

Add support for different audio format #22

bigtimebuddy opened this issue Jul 18, 2017 · 3 comments
Milestone

Comments

@bigtimebuddy
Copy link
Member

Suggest using a glob-like API which allows you to set type for loading different audio files.

PIXI.sound.add('music', 'sounds/music.{mp3,ogg}');

In this case, mp3 would be loaded highest-priority with fallback to ogg.

@bigtimebuddy bigtimebuddy modified the milestone: v2.0.0 Jul 18, 2017
@englercj
Copy link
Member

most systems use an array of urls and chose the one the browser supports at runtime. For example, I use different paths for different formats of sounds.

@englercj
Copy link
Member

The loader does this by adding each url as a "source" and letting the browser decide which to load.

@bigtimebuddy
Copy link
Member Author

Yup, that's my assumption too. In my example above, if sounds/music.mp3 cannot be played, will use sounds/music.ogg. I wanted something that's not super verbose. Currently pixi sound only supports a single file.

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

No branches or pull requests

2 participants