-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Hi, I have two large WAV files that I want to load, process and save in chunks because they won't fit into my memory. I have the code below but I am getting an error when trying to use the savestreaming function.
using FileIO: load, save, loadstreaming, savestreaming
import LibSndFile
d = mktempdir()
a,b = randn(Float32,10000,4), randn(Float32,10000,4)
save(joinpath(d,"f1.wav"), a, Fs=8000)
save(joinpath(d,"f2.wav"), b, Fs=8000)
savestream = savestreaming(joinpath(d,"s1.wav"))
for wavfile in ["f1.wav", "f2.wav"]
loadstreaming(joinpath(d,wavfile)) do audio
while !eof(audio)
chunk = read(audio, 100) # read 100 frames
# process the chunk
chunk -= .001
write(savestream, chunk)
end
end
end
close(savestream)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels