Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes for Julia 1.11 #172

Merged
merged 12 commits into from
Oct 9, 2024
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ dmypy.json
docs/build/
docs/site/
Manifest.toml
Manifest-v*.toml
ararslan marked this conversation as resolved.
Show resolved Hide resolved

# misc
*.DS_Store
4 changes: 4 additions & 0 deletions examples/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[deps]
Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
FLAC_jll = "1d38b3a6-207b-531b-80e8-c83f48dafa73"
Legolas = "741b9549-f6ed-4911-9fbf-4a1c0c97f0cd"
Onda = "e853f5be-6863-11e9-128d-476edb89bfb5"
TimeSpans = "bb34ddd2-327f-4c4a-bfb0-c98fc494ece1"

[compat]
FLAC_jll = "1.3.3"
2 changes: 1 addition & 1 deletion examples/flac.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ FLACFormat(info; kwargs...) = FLACFormat(LPCMFormat(info); sample_rate=info.samp

Onda.register_lpcm_format!(file_format -> file_format == "flac" ? FLACFormat : nothing)

file_format_string(::FLACFormat) = "flac"
Onda.file_format_string(::FLACFormat) = "flac"

function flac_raw_specification_flags(format::FLACFormat{S}) where {S}
return (level="--compression-level-$(format.level)",
Expand Down
2 changes: 1 addition & 1 deletion src/serialization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ function serialize_lpcm(format::LPCMFormat, samples::AbstractMatrix)
samples isa Matrix && return reinterpret(UInt8, vec(samples))
io = IOBuffer()
write(io, samples)
return resize!(io.data, io.size)
return take!(seekstart(io))
end

function serialize_lpcm(stream::LPCMStream, samples::AbstractMatrix)
Expand Down
5 changes: 4 additions & 1 deletion test/samples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ end
sample_offset_in_unit=-0.5,
sample_type=Int16,
sample_rate=50.2)
samples = Samples(rand(Random.MersenneTwister(0), sample_type(info), 3, 5), info, true)
data = Int16[20032 4760 27427 -20758 24287
14240 5037 5598 -5888 21784
16885 600 20880 -32493 -19305]
palday marked this conversation as resolved.
Show resolved Hide resolved
samples = Samples(data, info, true)
M = VERSION >= v"1.6" ? "Matrix{Int16}" : "Array{Int16,2}"
@test sprint(show, samples, context=(:compact => true)) == "Samples(3×5 $M)"
@test sprint(show, samples) == """
Expand Down
Loading