I’d like to use Pluto.jl to create a small utility which processes and uploaded audio file. However, I’m unsure how to convert the uploaded audio file into a format usable with JuliaAudio’s ecosystem and SampledSignals.jl .
Through Pluto.jl I have the filename, filetype, and raw data, but as far as I can tell there’s no way to trivially process the raw data into a usable format. Normally I’d use FileIO to read the file directly, but given that the file is uploaded through Pluto I don’t believe this is an option.
Is it possible just to use FileIO to process the raw file data without having it read the file off disk as well? Thank you!
You can read the file/data into an
IOBuffer (or use your existing data as the memory of the
IOBuffer) and put that into
FileIO. It should pretty much work out of the box, I think.
That appears to work! Thank you!
For audio files “FileIO” can read/and write different formats
using FileIO, Plots
data, sr = load("../Music/AC_DC/Hells Bells.flac")
start, stop, marker, b = 0.7, 29.3, 19.4, 6000
ct(t) = Int(round(t*sr))
data = data[ct(start):ct(stop),2]
anim = @animate for a = 1:50
plot(data, grid=false, leg=false, layout=(3,1))
plot!(data[90a:90a+b], leg=false, annotations=(b,0.28,text(a,12,:right)), sp=2)
plot!(reverse(data[1:ct(marker)]), leg=false, lc=:orange, sp=3)
gif(anim,"audio animation.gif", fps=10)