# FileIO without filesystem access?

**URL:** <https://discourse.julialang.org/t/fileio-without-filesystem-access/70429>\
**Category:** General Usage\
**Tags:** pluto, file\
**Created:** [October 26, 2021, 7:06pm UTC](https://discourse.julialang.org/t/fileio-without-filesystem-access/70429 "2021-10-26T19:06:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sporklpony](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@sporklpony](https://discourse.julialang.org/u/sporklpony)\
**Post date:** [October 26, 2021, 7:06pm UTC](https://discourse.julialang.org/t/fileio-without-filesystem-access/70429/1 "2021-10-26T19:06:45Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [October 26, 2021, 8:33pm UTC](https://discourse.julialang.org/t/fileio-without-filesystem-access/70429/2 "2021-10-26T20:33:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sporklpony](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@sporklpony](https://discourse.julialang.org/u/sporklpony)\
**Post date:** [October 26, 2021, 11:20pm UTC](https://discourse.julialang.org/t/fileio-without-filesystem-access/70429/3 "2021-10-26T23:20:12Z")

</div>

That appears to work! Thank you!

---

<div class="post-metadata">

**Author:** ![trilobit](https://avatars.discourse-cdn.com/v4/letter/t/a8b319/32.png) [@trilobit](https://discourse.julialang.org/u/trilobit)\
**Post date:** [October 27, 2021, 7:08am UTC](https://discourse.julialang.org/t/fileio-without-filesystem-access/70429/4 "2021-10-27T07:08:31Z")

</div>

For audio files “FileIO” can read/and write different formats  
i.e.

```julia
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)
end
save("audio.wav",data[1:ct(marker)], samplerate=sr)
gif(anim,"audio animation.gif", fps=10)

```
