-
Notifications
You must be signed in to change notification settings - Fork 9
Update to Julia package state of the art #33
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
Open
gnadt
wants to merge
6
commits into
JuliaAudio:master
Choose a base branch
from
gnadt:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d03c33e
Update .gitignore with standard stuff
gnadt ddd84a4
Add compat
gnadt bf970cd
Update workflows
gnadt b456c95
Refactor tests to use TestItemRunner
gnadt 4ec55a1
Update readme links
gnadt de1ada7
Rename bitrate to samplerate in mpg123_getformat()...
gnadt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,17 @@ | ||
| name: CompatHelper | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: 0 0 * * * | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| CompatHelper: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: "Install CompatHelper" | ||
| run: | | ||
| import Pkg | ||
| name = "CompatHelper" | ||
| uuid = "aa819f21-2bde-4658-8897-bab36330d9b7" | ||
| version = "2" | ||
| Pkg.add(; name, uuid, version) | ||
| shell: julia --color=yes {0} | ||
| - name: "Run CompatHelper" | ||
| run: | | ||
| import CompatHelper | ||
| CompatHelper.main() | ||
| shell: julia --color=yes {0} | ||
| - name: Pkg.add("CompatHelper") | ||
| run: julia -e 'using Pkg; Pkg.add("CompatHelper")' | ||
| - name: CompatHelper.main() | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }} | ||
| run: julia -e 'using CompatHelper; CompatHelper.main()' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,9 @@ | ||
| *.jl.cov | ||
| *.jl.*.cov | ||
| *.jl.mem | ||
| .DS_Store | ||
| .vscode/ | ||
| dev/ | ||
| LocalPreferences.toml | ||
| Manifest.toml | ||
| Overrides.toml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,68 +1,5 @@ | ||
| using FileIO | ||
| using MP3 | ||
| using SampledSignals | ||
| using TestItemRunner | ||
|
|
||
| using Test | ||
| @testitem "Test MP3" begin include("test_mp3.jl") end | ||
|
|
||
| # encoding and decoding can introduce some delay | ||
| DELAY_THRESHOLD = 1160 | ||
|
|
||
| # write your own tests here | ||
| @testset "Loading MP3" begin | ||
| reference = load(joinpath(dirname(@__FILE__), "Sour_Tennessee_Red_Sting.mp3")) | ||
| @test typeof(reference) == SampledSignals.SampleBuf{PCM16Sample,2} | ||
| @test size(reference, 2) == 2 | ||
| @test abs(size(reference, 1) - 245376) <= DELAY_THRESHOLD | ||
| @test reference.samplerate == 44100 | ||
| end | ||
|
|
||
| @testset "Saving MP3" begin | ||
| # drop the volume so we don't get any clipping during resampling | ||
| reference = load(joinpath(dirname(@__FILE__), "Sour_Tennessee_Red_Sting.mp3")) * 0.9 | ||
|
|
||
| outpath = "$(tempname()).mp3" | ||
| save(outpath, reference) | ||
| audio = load(outpath) | ||
| @test size(audio) == size(reference) | ||
| @test audio.samplerate == reference.samplerate | ||
|
|
||
| for samplerate in [8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000] | ||
| save(outpath, reference; samplerate = samplerate) | ||
| audio = load(outpath) | ||
| @test audio.samplerate == samplerate | ||
| end | ||
|
|
||
| for bitrate in [96, 128, 160, 192, 224, 256, 320] | ||
| save(outpath, reference; bitrate = bitrate) | ||
| audio = load(outpath) | ||
| @test size(audio, 2) == size(reference, 2) | ||
| @test abs(size(audio, 1) - size(reference, 1)) <= DELAY_THRESHOLD | ||
| end | ||
|
|
||
| save(outpath, reference[:, 1]) | ||
| audio = load(outpath) | ||
| @test size(audio, 2) == 1 | ||
|
|
||
| save(outpath, reference[:, 2]) | ||
| audio = load(outpath) | ||
| @test size(audio, 2) == 1 | ||
|
|
||
| save(outpath, reference[:, 1]; nchannels = 2) | ||
| audio = load(outpath) | ||
| @test size(audio, 2) == 2 | ||
|
|
||
| f32 = map(Float32, reference) | ||
| save(outpath, f32) | ||
| audio = load(outpath) | ||
| @test audio.samplerate == 44100 | ||
| @test size(audio, 2) == size(reference, 2) | ||
| @test abs(size(audio, 1) - size(reference, 1)) <= DELAY_THRESHOLD | ||
|
|
||
| f64 = map(Float32, reference) | ||
| save(outpath, f64) | ||
| @test audio.samplerate == 44100 | ||
| @test size(audio, 2) == size(reference, 2) | ||
| @test abs(size(audio, 1) - size(reference, 1)) <= DELAY_THRESHOLD | ||
|
|
||
| rm(outpath) | ||
| end | ||
| @run_package_tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| using FileIO, MP3, SampledSignals, Test | ||
|
|
||
| # encoding and decoding can introduce some delay | ||
| DELAY_THRESHOLD = 1160 | ||
|
|
||
| @testset "Load MP3" begin | ||
| reference = load(joinpath(dirname(@__FILE__), "Sour_Tennessee_Red_Sting.mp3")) | ||
| @test typeof(reference) == SampledSignals.SampleBuf{PCM16Sample,2} | ||
| @test size(reference, 2) == 2 | ||
| @test abs(size(reference, 1) - 245376) <= DELAY_THRESHOLD | ||
| @test reference.samplerate == 44100 | ||
| end | ||
|
|
||
| @testset "Save MP3" begin | ||
| # drop the volume so we don't get any clipping during resampling | ||
| reference = load(joinpath(dirname(@__FILE__), "Sour_Tennessee_Red_Sting.mp3")) * 0.9 | ||
|
|
||
| outpath = "$(tempname()).mp3" | ||
| save(outpath, reference) | ||
| audio = load(outpath) | ||
| @test size(audio) == size(reference) | ||
| @test audio.samplerate == reference.samplerate | ||
|
|
||
| for samplerate in [8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000] | ||
| save(outpath, reference; samplerate = samplerate) | ||
| audio = load(outpath) | ||
| @test audio.samplerate == samplerate | ||
| end | ||
|
|
||
| for bitrate in [96, 128, 160, 192, 224, 256, 320] | ||
| save(outpath, reference; bitrate = bitrate) | ||
| audio = load(outpath) | ||
| @test size(audio, 2) == size(reference, 2) | ||
| @test abs(size(audio, 1) - size(reference, 1)) <= DELAY_THRESHOLD | ||
| end | ||
|
|
||
| save(outpath, reference[:, 1]) | ||
| audio = load(outpath) | ||
| @test size(audio, 2) == 1 | ||
|
|
||
| save(outpath, reference[:, 2]) | ||
| audio = load(outpath) | ||
| @test size(audio, 2) == 1 | ||
|
|
||
| save(outpath, reference[:, 1]; nchannels = 2) | ||
| audio = load(outpath) | ||
| @test size(audio, 2) == 2 | ||
|
|
||
| f32 = map(Float32, reference) | ||
| save(outpath, f32) | ||
| audio = load(outpath) | ||
| @test audio.samplerate == 44100 | ||
| @test size(audio, 2) == size(reference, 2) | ||
| @test abs(size(audio, 1) - size(reference, 1)) <= DELAY_THRESHOLD | ||
|
|
||
| f64 = map(Float32, reference) | ||
| save(outpath, f64) | ||
| @test audio.samplerate == 44100 | ||
| @test size(audio, 2) == size(reference, 2) | ||
| @test abs(size(audio, 1) - size(reference, 1)) <= DELAY_THRESHOLD | ||
|
|
||
| rm(outpath) | ||
| end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's this part about?