Thanks @floooh :).
This morning someone on the Zig discord helped me figure out that the issue is due to undefined behaviour sanitize “ubsan”. Basically zig having better defaut for building than gcc and clang. Building in ReleaseFast makes the error go away and the sound playing.
When staticaly linking you can set the optimize for the lib itself within the “addStaticLibrary” to ReleaseFast