How to save a 24 bit wav file?

OK, finally it seems I found the good way:

using FileIO
using LibSndFile

LibSndFile.subformatcode(::Type{LibSndFile.PCM32Sample}) = 0x00000003  # Default is 0x00000004 (for 32 bit); see https://github.com/JuliaAudio/LibSndFile.jl/blob/master/src/libsndfile_h.jl.
soundfile = load("original.wav")
save("test.wav", soundfile)

I don’t know if there is a better way to do that, without involving some arguments or easier configuration, but it seems to work!

1 Like