Skip to content

Streamed Music (Rewritten Internal Audio) #4

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

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

Conversation

Raltyro
Copy link
Contributor

@Raltyro Raltyro commented Jul 10, 2025

  • Reworked Internal Audio (FlxSound, NativeAudioSource, SoundChannel) to work with Streaming Vorbis Files (for now?)

    • FlxSound.amplitude now works. (This is implemented to avoid the lagspike on using the AudioAnalyzer on streamed audios as possible)
    • Implemented loopTime, and endTime into the internal instead of FlxSound for better looping (only for Streamed Audio)
    • Implemented Interpolation into time (only in FlxSound specifically, does not affect the actual internal audio classes)
    • Implemented variables such as offset, muted, pan, proximityPan, channels, stereo, loaded, streamed, onFinish (to seperate complete callback from looping callback), timeScaleBased (for pitch based in FlxG.timeScale)
  • Reworked AudioAnalyzer to work with all type of audios (hopefully) and work with Streamed Audio. (NOTE: Using it on Streamed Audio is pretty expensive as it constantly seeking each calls.)

  • Redo AudioSwitchFix to work in time instead of when switching states.

  • Improved the off-sync vocals detection

  • Implemented LoopTime, EndTime, Offset into Ini's Music Assets

For Modders that are using AudioAnalyzer if this pull request did get pushed, change any codes of audioanalyzer that only checks of a sound current time to just only use FlxSound.amplitude

@Raltyro
Copy link
Contributor Author

Raltyro commented Jul 10, 2025

WHAT IS HAPPENING IT JUST LITERALLY BROKE WHEN I MOVE IT HEREE!!!

@Raltyro Raltyro marked this pull request as draft July 10, 2025 08:44
@Raltyro Raltyro marked this pull request as ready for review July 10, 2025 09:17
@Raltyro Raltyro marked this pull request as draft July 10, 2025 10:26
@Raltyro
Copy link
Contributor Author

Raltyro commented Jul 10, 2025

Known Issues:

When streamed music buffers have been looped and gets interuppted, it'll crash
Random Noises on Looping Streamed Music(?) figure this shit out first cuz its so annoying.
AudioAnalyzer breaks if a selected sound is streamed instead of static.

@Raltyro
Copy link
Contributor Author

Raltyro commented Jul 10, 2025

I actually might have to redo the implementation of streaming because this alone is fucking my head, its an old code

@Raltyro
Copy link
Contributor Author

Raltyro commented Jul 11, 2025

Technically its done, but just need to somehow make it to clone the decoder so the AudioAnalyzer can read from it too

@Raltyro Raltyro changed the title Streamed Music Streamed Music (Rewritten Internal Audio) Jul 12, 2025
- Reworked Internal Audio to work with Streaming Vorbis Files (for now?)
- FlxSound.amplitude, FlxSound.amplitudeLeft, FlxSound.amplitudeRight, SoundChannel.leftPeak, SoundChannel.rightPeak now works. (Streamed Audio on this seems to be half-broken)
- Reworked AudioAnalyzer to work with all type of audios (hopefully) and work with Streamed Audio.
- Redo AudioSwitchFix to work in time instead of when switching states.

gosh, and all that i hope it doesnt break anything.
@Raltyro Raltyro marked this pull request as ready for review July 13, 2025 12:56
@Raltyro
Copy link
Contributor Author

Raltyro commented Jul 13, 2025

Actually for vorbis in audioanalyzer, ill just make a detection if a current source is in the request of startPos and endPos, that way its way faster

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