You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
Activity
abhayap commentedon Feb 21, 2022
This is the error I am getting.