diff --git a/JlSonic/api.jl b/JlSonic/api.jl index 56ab67d..0627433 100644 --- a/JlSonic/api.jl +++ b/JlSonic/api.jl @@ -514,12 +514,11 @@ function getCoverArt(req::Dict) end function giveconverted(file, bitrate, format) - (iodata, proc) = convert(file, bitrate = bitrate, format = format) + iodata = convert(file, bitrate = bitrate, format = format) headers = Dict{String,String}() suffix = format mime = suffix in keys(Mux.mimetypes) ? Mux.mimetypes[suffix] : suffix headers["Content-Type"] = mime - wait(proc) # headers["Content-Length"] = string(length(data)) return Dict(:body => read(iodata), :headers => headers) end @@ -528,8 +527,8 @@ function convert(infile; bitrate = 64, format = "oga") global ffmpeg_threads io = IOBuffer() p = run(pipeline(`ffmpeg -i $infile -y -c:a libvorbis -b:a $(bitrate)k -threads $(ffmpeg_threads) -f $format pipe:1`, - stderr=devnull, stdout=io), wait = false) - (io, p) + stderr=devnull, stdout=io), wait = true) + io end canstream(u::User) = u.stream