{"id":23444091,"url":"https://github.com/sevagh/audio-degradation-toolbox","last_synced_at":"2025-04-13T12:34:23.100Z","repository":{"id":65921347,"uuid":"175921490","full_name":"sevagh/audio-degradation-toolbox","owner":"sevagh","description":"easy-to-use implementation of the ISMIR 2013 Audio Degradation Toolbox","archived":false,"fork":false,"pushed_at":"2019-11-19T12:07:05.000Z","size":45,"stargazers_count":48,"open_issues_count":0,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T01:01:52.555Z","etag":null,"topics":["audio-effects","audio-processing","dsp","impulse-response","pitch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sevagh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-16T03:27:36.000Z","updated_at":"2025-02-02T05:19:27.000Z","dependencies_parsed_at":"2023-02-16T10:25:13.634Z","dependency_job_id":null,"html_url":"https://github.com/sevagh/audio-degradation-toolbox","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sevagh%2Faudio-degradation-toolbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sevagh%2Faudio-degradation-toolbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sevagh%2Faudio-degradation-toolbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sevagh%2Faudio-degradation-toolbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sevagh","download_url":"https://codeload.github.com/sevagh/audio-degradation-toolbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248714644,"owners_count":21149931,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio-effects","audio-processing","dsp","impulse-response","pitch"],"created_at":"2024-12-23T18:26:38.108Z","updated_at":"2025-04-13T12:34:23.068Z","avatar_url":"https://github.com/sevagh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Python 3 implementation of the MATLAB [Audio Degradation Toolbox](https://code.soundsoftware.ac.uk/projects/audio-degradation-toolbox). The license is GPL due to the original code being GPL. The aim is full feature parity with:\n\n* Original MATLAB toolbox (with ISMIR2013 additions)\n* A similar tool, [audio_degrader](https://github.com/EliosMolina/audio_degrader)\n\nThis tool can read non-WAV files as input, but only outputs single-channel WAV files - this is because I find that WAV is the most universal format with friendly-licensed libraries in any language.\n\n### Available degradations\n\n```\n$ audio-degradation-toolbox -h\nusage: audio-degradation-toolbox [-h] [-d DEGRADATIONS_FILE] [-p] [-t]\n                                 input_path output_path\n\nApply controlled degradations to an audio file, specified in a JSON file containing an array of degradations (executed in order).\n\nPaths are relative to the execution dir, and square brackets denote optional arguments along with their default values.\n\n    { \"name\": \"noise\", [\"snr\": 20, \"color\": \"pink\"] }\n    { \"name\": \"mp3\", [\"bitrate\": 320] }\n    { \"name\": \"gain\", [\"volume\": 10.0] }\n    { \"name\": \"normalize\" }\n    { \"name\": \"low_pass\", [\"cutoff\": 1000.0] }\n    { \"name\": \"high_pass\", [\"cutoff\": 1000.0] }\n    { \"name\": \"trim_millis\", [\"amount\": 100, \"offset\": 0] }\n    { \"name\": \"mix\", \"path\": STRING, [\"snr\": 20.0] }\n    { \"name\": \"speedup\", \"speed\": FLOAT }\n    { \"name\": \"resample\", \"rate\": INT }\n    { \"name\": \"pitch_shift\", \"octaves\": FLOAT }\n    { \"name\": \"dynamic_range_compression\", [\"threshold\": -20.0, \"ratio\": 4.0, \"attack\": 5.0, \"release\": 50.0] }\n    { \"name\": \"impulse_response\", \"path\": STRING }\n    { \"name\": \"equalizer\", \"frequency\": FLOAT, [\"bandwidth\": 1.0, \"gain\": -3.0] }\n    { \"name\": \"time_stretch\", \"factor\": FLOAT }\n    { \"name\": \"delay\", \"n_samples\": INT }\n    { \"name\": \"clipping\", [\"n_samples\": 0, \"percent_samples\": 0.0] }\n    { \"name\": \"wow_flutter\", [\"intensity\": 1.5, \"frequency\": 0.5, \"upsampling_factor\": 5.0 ] }\n    { \"name\": \"aliasing\", [\"dest_frequency\": 8000.0] }\n    { \"name\": \"harmonic_distortion\", [\"num_passes\": 3] }\n\npositional arguments:\n  input_path            Path to input file\n  output_path           Path to output WAV file\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -d DEGRADATIONS_FILE, --degradations-file DEGRADATIONS_FILE\n                        JSON file of degradations to apply\n  -p, --play            Play file audio at each degradation step\n  -t, --trim            Trim trailing and leading silences\n```\n\n### Presets and samples\n\nSome of the ISMIR2013 degradations are chains of basic degradations. Given the JSON format that my tool accepts, these are most easily represented as JSON files in the [presets](./presets) dir.\n\n[Samples](./samples), mostly IR wav files, come from the original MATLAB repository. I've resampled them from 96000 to 48000 with ffmpeg, since pydub has questionable support for 96000.\n\n### Install, develop, contribute\n\nIt should be as easy as `pip3 install .` after cloning this repository. Afterwards, run `audio-degradation-toolbox`. You may need to install `sox` from your OS package manager for some effects.\n\nTo develop, `pip3 install -e .`. The code is formatted with [black](https://github.com/ambv/black), so run that before contributing anything. To run tests, run `python3 -m unittest discover`.\n\nTo use the `--play` flag (i.e. play the audio clip between each degradation), you must have `mpv` installed and in `$PATH`:\n\n```\nsevagh:audio-degradation-toolbox $ audio-degradation-toolbox \\\n        Viola.arco.ff.sulC.E3.stereo.aiff \\\n        Viola-E3-degraded.wav \\\n        --degradations-file ./degradations.json \\\n        --play\nPlaying audio before degradations\nA: 00:00:03 / 00:00:03 (93%)\nApplied degradation noise with params color: white, snr: 20\nPlaying audio after degradation\nA: 00:00:03 / 00:00:03 (93%)\n```\n\n### Usage\n\nWrite the desired degradations in a JSON file, e.g.:\n\n```\n$ cat degradations.json\n[\n  {\n    \"name\": \"trim_millis\",\n    \"amount\": 500\n  },\n  {\n    \"name\": \"noise\",\n    \"color\": \"violet\",\n    \"snr\": 10\n  },\n  {\n    \"name\": \"mix\",\n    \"path\": \"./restaurant08.wav\",\n    \"snr\": 15\n  }\n]\n```\n\nAfterwards, apply the degradations with:\n\n```\n$ audio-degradation-toolbox -d degradations.json in.wav out_degraded.wav\n```\n\n### Unimplemented\n\nMfccMeanAdaption and AdaptiveEqualizer (both from the MATLAB original).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsevagh%2Faudio-degradation-toolbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsevagh%2Faudio-degradation-toolbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsevagh%2Faudio-degradation-toolbox/lists"}