[OPTIMIZATION] Use streamed audio for Freeplay Song Previews #6540
+42
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Linked Issues
Nothing, heh, it's like that one soyjak gif.
Description
This PR makes it so that on targets that have the
lime_vorbisfeature flag enabled, freeplay previews will attempt to be loaded through the vorbis file first before using the regular partial sound method.I'd love to make more things use streamed audio for optimization, though there are some roadblocks to this:
loadandloadPartialfunctions, which also affected sound effects played through theplayOncefunction.Also if the code looks a bit ugly, that's because I had to apply
endTimeto the loaded sound so that it's actually a partial sound in a very specific position, since fading in the sound callsplaywithout any arguments, which means thatendTimeis set to null and it makes the previews not partial anymore, spoiling the entire instrumental in the preview.............Screenshots/Videos
smooth.scrolling.hell.yes.mp4