Ogg files load way more slowly than wav files
See original GitHub issueIssue details
The only change I make is to switch my sound effect folder all to .ogg rather than .wav and the load time difference is:
All wav sounds: assets 229 screen 441
All ogg sounds: assets 1548 screen 1749
The difference in loading time is somewhat noticeable anyway, but I’ve provided the actual times for clarity.
Reproduction steps/code
Load sound effects as ordinary Sound
files as wav and then all as ogg and test the loading time of each.
Version of libGDX and/or relevant dependencies
1.10.0
Please select the affected platforms
- MacOS
Issue Analytics
- State:
- Created 2 years ago
- Comments:26 (14 by maintainers)
Top Results From Across the Web
File Explorer is slow showing properties for .ogg type files.
ogg file to view the properties, File Explorer freezes for over a minute before finally completing the action. This problem only appears with...
Read more >Why are folders filled with ogg files so slow? : r/windows - Reddit
This is really annoying, especially when I have to access multiple folders. This delay doesn't seem to occur with other folders.
Read more >How to improve load times of audio files without loosing too ...
Unlike MP3, OGG or WAV files, a MIDI file is not an audio recording. Instead, it is a set of instructions used to...
Read more >Smallest audio file: MP3, Ogg, or Wav? - Stack Overflow
Of those three, Ogg would usually be smaller than MP3 . Both would be much smaller than the uncompressed WAV . Of course,...
Read more >How to slow down audio files? [closed] - Super User
The recorded information is constant, this just changes how it is played back (and, thus, can make a recording sound slower).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I feel like I’ve been to Hell and back, figuring out Unity. Think I’ve managed to conjure up an equivalent test - loading an
AudioClip
from outside the project (libGDX test was also external). I think it might be possible to shave off ~50ms from this, but you get the picture. Here’s the current score on the three:libGDX is still the loser, but you need to be loading in an awful lot of audio in one go on desktop for it to really matter.
Oh, hey, entitlement city! So, first of all. As Nate sad, the decoders for both OGG and MP3 are pure Java decoders. That means they will be slow until the hot code paths have been run a few thousand times until the JIT compiler of the JVM kicks in. No mystery, conspiracy, etc.
What could be done:
And since libGDX is such a nice open-source project, you can totally send a PR that swaps out the Java decoder for OGG for the stb vorbis decoder in LWJGL 3 instead of telling people actually contributing code to and maintaining libgdx that their comments are useless.