diff --git a/JlSonic/api.jl b/JlSonic/api.jl index 3f31d40..8afd883 100644 --- a/JlSonic/api.jl +++ b/JlSonic/api.jl @@ -519,7 +519,7 @@ function giveconverted(file, bitrate, format) suffix = format mime = suffix in keys(Mux.mimetypes) ? Mux.mimetypes[suffix] : suffix headers["Content-Type"] = mime - headers["Content-Length"] = length(data) + headers["Content-Length"] = string(length(data)) return Dict(:body => data, :headers => headers) end @@ -542,6 +542,8 @@ function stream(req::Dict) isa(e, ArgumentError) && 0 @error e end + # Ogg is not compativle with lower bitrates. Use something else? + bitrate = bitrate < 64 ? 64 : bitrate format = get(query, "format", "oga") songs = Beets.songs()