Skip to content

Commit

Permalink
Update for Julia 1.3+, use JLL packages and whatnot (#7)
Browse files Browse the repository at this point in the history
Update for Julia 1.3+, use JLL packages and whatnot
  • Loading branch information
staticfloat committed Dec 19, 2019
2 parents c2cd769 + 46da526 commit 3c28a4d
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 89 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ language: julia
os:
- linux
- osx
- windows
julia:
1.0
- 1.3
- nightly
notifications:
email: false
# uncomment the following lines to override the default test script
Expand Down
89 changes: 89 additions & 0 deletions Manifest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# This file is machine-generated - editing it directly is not advised

[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"

[[Distributed]]
deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"

[[FileIO]]
deps = ["Pkg"]
git-tree-sha1 = "80c17c711c41416eb0ac68347dc036be68b37682"
uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
version = "1.2.0"

[[InteractiveUtils]]
deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"

[[LibGit2]]
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"

[[Libdl]]
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"

[[Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"

[[Markdown]]
deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"

[[Ogg]]
deps = ["FileIO", "Ogg_jll", "Test"]
git-tree-sha1 = "115de1bcae81dd83f2f1578439d7bc4192993d72"
uuid = "796d8c31-69d0-5366-9081-a3bf997f4f0d"
version = "1.0.0"

[[Ogg_jll]]
deps = ["Libdl", "Pkg"]
git-tree-sha1 = "f4d4d03c562f40652c0baabd3e4cb2e756e157b7"
uuid = "e7412a2a-1a6e-54c0-be00-318e2571c051"
version = "1.3.3+0"

[[Opus_jll]]
deps = ["Libdl", "Pkg"]
git-tree-sha1 = "c9931bf2fcdb57b48c227395c61ea82603212f7d"
uuid = "91d4177d-7536-5919-b921-800302f37372"
version = "1.3.1+0"

[[Pkg]]
deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

[[Printf]]
deps = ["Unicode"]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"

[[REPL]]
deps = ["InteractiveUtils", "Markdown", "Sockets"]
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"

[[Random]]
deps = ["Serialization"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[[SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"

[[Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"

[[Sockets]]
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"

[[Test]]
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[[UUIDs]]
deps = ["Random", "SHA"]
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[[Unicode]]
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
22 changes: 22 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name = "Opus"
uuid = "0af1e411-0638-4d6d-bb05-ed1900b440d5"
version = "1.0.0"

[deps]
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
Ogg = "796d8c31-69d0-5366-9081-a3bf997f4f0d"
Opus_jll = "91d4177d-7536-5919-b921-800302f37372"

[compat]
FileIO = "1.1"
Ogg = "1.0"
Opus_jll = "1.3.1"
julia = "1.3"

[extras]
DSP = "717857b8-e6f2-59f4-9121-6e50c889abd2"
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "DSP", "FFTW"]
6 changes: 0 additions & 6 deletions REQUIRE

This file was deleted.

33 changes: 0 additions & 33 deletions appveyor.yml

This file was deleted.

30 changes: 0 additions & 30 deletions deps/build.jl

This file was deleted.

12 changes: 1 addition & 11 deletions src/Opus.jl
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
__precompile__()
module Opus
using Compat
using Ogg
using Ogg, Opus_jll
using FileIO
import Base: convert, show, write

export OpusDecoder, OpusEncoder, OpusArray, load, save

const depfile = joinpath(dirname(@__FILE__), "..", "deps", "deps.jl")
if isfile(depfile)
include(depfile)
else
error("libopus not properly installed. Please run Pkg.build(\"Opus\")")
end


include("defines.jl")
include("decoder.jl")
include("encoder.jl")
Expand Down
2 changes: 1 addition & 1 deletion src/encoder.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function save(output::Union{File{format"OPUS"},AbstractString,IO}, audio::Array{
insert!(packets, 1, opus_head)
opus_tags = OpusTags()
insert!(packets, 2, opus_tags)
Ogg.save(output, packets, granulepos)
Ogg.save(output, Dict(Clong(1) => packets), Dict(Clong(1) => Int64.(granulepos)))
end

function save(output::Union{File{format"OPUS"},AbstractString,IO}, audio::Array, fs; chunksize=960)
Expand Down
9 changes: 2 additions & 7 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using Compat
using Compat.Test
using Opus
using Ogg
using DSP
using FFTW
using Test, Opus, Ogg, DSP, FFTW

testdir = dirname(@__FILE__)

Expand All @@ -28,7 +23,7 @@ filtered_noise = filt([0.018, 0.054, 0.054, 0.018], [1.0, -1.760, 1.182, -0.278]
# Each signal is harder for Opus to model, so increase the error bounds for each one
@test avg_roundtrip_error(sin_signal) < .01
@test avg_roundtrip_error(harmonic_signal) < .02
@test avg_roundtrip_error(filtered_noise) < .1
@test avg_roundtrip_error(filtered_noise) < .3


# Now perform some tests to ensure that we can decode some Ogg Opus files
Expand Down

2 comments on commit 3c28a4d

@staticfloat
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/6934

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v1.0.0 -m "<description of version>" 3c28a4d1a5959b8e01bfe4a8c6f46f8bb82f16ff
git push origin v1.0.0

Please sign in to comment.