Stable Reworked Audio

- 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.
This commit is contained in:
Ralty
2025-07-13 19:56:26 +07:00
parent 3f19afd66d
commit e669eb32af
10 changed files with 647 additions and 219 deletions
+1 -2
View File
@@ -248,8 +248,7 @@ class Assets
var path = getPath(id);
// TODO: What if it is a WAV or non-Vorbis file?
var vorbisFile = VorbisFile.fromFile(path);
var buffer = AudioBuffer.fromVorbisFile(vorbisFile);
return Sound.fromAudioBuffer(buffer);
if (vorbisFile != null) return Sound.fromAudioBuffer(AudioBuffer.fromVorbisFile(vorbisFile));
}
#end
return getSound(id, useCache);