-
Notifications
You must be signed in to change notification settings - Fork 481
Rework FlxSound load methods #3479
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
base: dev
Are you sure you want to change the base?
Conversation
Is this something that can be unit tested? I'm genuinely not sure. |
I'm a bit unfamiliar when it comes to unit tests. Maybe we could check if the internal sound ( |
NVM, FlxSoundTest doesn't actually test any of the existing args, so let's look into that in the future |
Just gonna say it, a byte array isn't "embedded", so it's odd to use this to load it... Maybe we should add a new Thoughts? |
Sounds good. While we're at it, I think it might be worth renaming Streamed sounds are helpful to use less memory when dealing with large music tracks for example. Instead of loading the entire file and playing it, they load (and unload) smaller chunks of data as they play. We could have something like |
Also Openfl does have the ability to "stream" audio, but I don't know if flixel leverages this |
I believe it doesn't. I think we just have to use |
I forgot how I did it, but there's a way on html5 to stream a sound from the web |
Should I repurpose this and also include the load() changes here or should that be done in a seperate PR? |
Please include that change, here |
850be68
to
a0fec3b
Compare
Closes #3466.
loadEmbedded()
,loadStream()
andloadByteArray()
and replaces them withload()
andloadFromURL()
.FlxG.sound.stream()
forFlxG.sound.loadFromURL()
to stay consistentloadStreamed()
to allow loading streamed sounds. Additionally adds required functionality toFlxG.assets
FlxSoundAsset
to allow passing in a ByteArray.