Skip to content

Conversation

@ACrazyTown
Copy link
Contributor

@ACrazyTown ACrazyTown commented Nov 8, 2025

Been testing this internally and it's been working well so I thought it'd be time to do a PR.

In short:

  • AssetsFrontEnd: adds support for the MUSIC asset type (essentially the same thing as SOUND, but streamed)
  • FlxSound: adds the FlxSound.loadStreamed() method which uses audio streaming under the hood. Very useful for large audio tracks as it loads chunks of data while it plays which results in small memory usage.

Audio streaming is currently only supported when targeting native and using OGG files, this is due to a limitation with Lime. I've been poking around trying to get streaming to work on HTML5 as well. I have a proof of concept, but it might require changes to OpenFL, so it'll be implemented in a later PR once that's all figured out.

Further considerations:

  • Should FlxG.sound.playMusic() use streaming?
  • Should we add a helper method akin to FlxG.sound.load() but for streamed sounds?

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

Successfully merging this pull request may close these issues.

1 participant