Skip to content

Commit 4389c58

Browse files
committed
Add FLAC.jl into registry for .wav and .flac
1 parent 5bc0bbf commit 4389c58

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/registry.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,20 @@ add_format(format"OFF", "OFF", ".off", [:MeshIO])
9999

100100

101101

102+
### Audio formats
103+
function detectwav(io)
104+
seekstart(io)
105+
magic = ascii(read(io, UInt8, 4))
106+
magic == "RIFF" || return false
107+
seek(io, 8)
108+
submagic = ascii(read(io, UInt8, 4))
109+
110+
submagic == "WAVE"
111+
end
112+
add_format(format"WAV", detectwav, "wav", [:FLAC])
113+
add_format(format"FLAC","fLaC",".flac",[:FLAC])
114+
115+
102116
### Complex cases
103117
# HDF5: the complication is that the magic bytes may start at
104118
# 0, 512, 1024, 2048, or any multiple of 2 thereafter

0 commit comments

Comments
 (0)