This was quite the Heisenbug: https://github.com/JD557/minart/pull/474
Some sound files were corrupted, but only when loaded from the Java resources on a specific application. When I loaded them on unit tests or Scala CLI scripts they would work fine. Even something as simple as loading them from a file (instead of a Java resource) would work .
Turns out sometimes InputStream.read(bytes)
does not read all the bytes (duh, that's why it returns the number of bytes read) and I was not handling that... not sure how I didn't hit this earlier .