-
Notifications
You must be signed in to change notification settings - Fork 483
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
There's still some quirks I need to figure out related to audio streaming. To not bloat this PR I'll strip out parts related to audio streaming and re-add them later in a separate PR. |
I misread this as rework flxsound like entirely, because i've did reworked the flxsounds once in one of gulp... FNF engine, which is still a mess that i was thinking of making a pull request on it later when its stable |
Maybe don't restrict MUSIC asset type to lime_vorbis in the future? since who knows if lime is going to add another format being able to streamed beside vorbis |
Yeah, that's something that could be addressed in a patch/minor release with a compiler conditional. I have to stick to checking |
Closes #3466.
loadEmbedded()
,loadStream()
andloadByteArray()
and replaces them withload()
andloadFromURL()
.FlxG.sound.stream()
forFlxG.sound.loadFromURL()
to stay consistentAddWill be addressed in a separate PRloadStreamed()
to allow loading streamed sounds. Additionally adds required functionality toFlxG.assets
FlxSoundAsset
to allow passing in a ByteArray.