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

[FEATURE] Ability to use Raw Times (ms) instead of percentages #5

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

KoloInDaCrib
Copy link

@KoloInDaCrib KoloInDaCrib commented Mar 11, 2025

the ms-using functions are separate from the percentage ones to not break anything

}

// on native, it will always be an ogg file, although eventually we might want to add WAV?
Assets.loadBytes(path).onComplete(function(data:openfl.utils.ByteArray)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This always loads the whole file. The intent of FlxPartialSound is to save memory and load times by only streaming part of the audio file. With this, you load a 3 minute audio file just to play 15 seconds of it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...but the function to load the future with the sound by using percentages also uses the same system - one way or another there would have to be all bytes being loaded for the partial sound, since loading bytes doesn't use cache

I've changed the system a bit to load the audio instead (which does use cache and every sound should be precached iirc) and to use that as a base instead of loading bytes again, however I'll leave this open

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, on further analysis, the original also loaded the whole file, hmmm...
This might need further review I think.

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.

2 participants