openfl / lime

A foundational Haxe framework for cross-platform development
https://lime.openfl.org/
MIT License
749 stars 359 forks source link

Increase audio length limit majorly on desktop #1780

Closed SomeGuyWhoLovesCoding closed 2 months ago

SomeGuyWhoLovesCoding commented 2 months ago

So, there was an int64 conversion in the way of making time, length, dataLength, and samples floats, causing an overflow once you get past the int64 limit. To fix that, I simply converted it to a float, and now you can load audio files over 6.6 hours with 44.1k sample rate!

I did make project/src/media/containers/OGG.cpp readable too.

I'm also planning to fix the memory leak problem and another problem with audio buffer when streaming audio. But I don't even know how I would fix that because I simply have never heard of some way to fix it entirely when doing new AudioSource(AudioBuffer.fromVorbisFile(VorbisFile.fromFile(sourceFile))) for the audio source (Which streams the ogg audio).

SomeGuyWhoLovesCoding commented 1 month ago

The reason why I closed this because it fucks up the audio playback on some native targets, especially on hl