{"id":19349611,"url":"https://github.com/johnvinyard/zounds","last_synced_at":"2025-04-23T06:30:55.888Z","repository":{"id":57478527,"uuid":"54522542","full_name":"JohnVinyard/zounds","owner":"JohnVinyard","description":"Zounds is a dataflow library for building directed acyclic graphs that transform audio. It uses the featureflow library to define the processing pipelines.","archived":false,"fork":false,"pushed_at":"2022-12-08T00:34:47.000Z","size":2443,"stargazers_count":24,"open_issues_count":27,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-14T23:11:33.860Z","etag":null,"topics":["audio","dsp","machine-learning","numpy","processing-pipelines","signal-processing","sound"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JohnVinyard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-23T01:55:04.000Z","updated_at":"2024-12-12T20:02:37.000Z","dependencies_parsed_at":"2023-01-25T01:15:16.777Z","dependency_job_id":null,"html_url":"https://github.com/JohnVinyard/zounds","commit_stats":null,"previous_names":[],"tags_count":75,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnVinyard%2Fzounds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnVinyard%2Fzounds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnVinyard%2Fzounds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnVinyard%2Fzounds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JohnVinyard","download_url":"https://codeload.github.com/JohnVinyard/zounds/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250384769,"owners_count":21421787,"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","dsp","machine-learning","numpy","processing-pipelines","signal-processing","sound"],"created_at":"2024-11-10T04:27:11.929Z","updated_at":"2025-04-23T06:30:54.796Z","avatar_url":"https://github.com/JohnVinyard.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/JohnVinyard/zounds.svg?branch=master)](https://travis-ci.org/JohnVinyard/zounds)\n[![Coverage Status](https://coveralls.io/repos/github/JohnVinyard/zounds/badge.svg?branch=master)](https://coveralls.io/github/JohnVinyard/zounds?branch=master)\n![Python 3](https://img.shields.io/pypi/pyversions/zounds.svg)\n[![PyPI](https://img.shields.io/pypi/v/zounds.svg)](https://pypi.python.org/pypi/zounds)\n[![Docs](https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat\u0026maxAge=86400)](http://zounds.readthedocs.io/en/latest/?badge=latest)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n# Motivation\n\nZounds is a python library for working with sound.  Its primary goals are to:\n\n- layer semantically meaningful audio manipulations on top of numpy arrays\n- [help to organize the definition and persistence of audio processing\n  pipelines and machine learning experiments with sound](https://github.com/JohnVinyard/zounds/tree/master/zounds/learn)\n\nAudio processing graphs and machine learning pipelines are defined using\n[featureflow](https://github.com/JohnVinyard/featureflow).\n\n# A Quick Example\n\n```python\nimport zounds\n\nResampled = zounds.resampled(resample_to=zounds.SR11025())\n\n\n@zounds.simple_in_memory_settings\nclass Sound(Resampled):\n    \"\"\"\n    A simple pipeline that computes a perceptually weighted modified discrete\n    cosine transform, and \"persists\" feature data in an in-memory store.\n    \"\"\"\n\n    windowed = zounds.ArrayWithUnitsFeature(\n        zounds.SlidingWindow,\n        needs=Resampled.resampled,\n        wscheme=zounds.HalfLapped(),\n        wfunc=zounds.OggVorbisWindowingFunc(),\n        store=True)\n\n    mdct = zounds.ArrayWithUnitsFeature(\n        zounds.MDCT,\n        needs=windowed)\n\n    weighted = zounds.ArrayWithUnitsFeature(\n        lambda x: x * zounds.AWeighting(),\n        needs=mdct)\n\nif __name__ == '__main__':\n\n    # produce some audio to test our pipeline, and encode it as FLAC\n    synth = zounds.SineSynthesizer(zounds.SR44100())\n    samples = synth.synthesize(zounds.Seconds(5), [220., 440., 880.])\n    encoded = samples.encode(fmt='FLAC')\n\n    # process the audio, and fetch features from our in-memory store\n    _id = Sound.process(meta=encoded)\n    sound = Sound(_id)\n\n    # grab all the frequency information, for a subset of the duration\n    start = zounds.Milliseconds(500)\n    end = start + zounds.Seconds(2)\n    snippet = sound.weighted[start: end, :]\n\n    # grab a subset of frequency information for the duration of the sound\n    freq_band = slice(zounds.Hertz(400), zounds.Hertz(500))\n    a440 = sound.mdct[:, freq_band]\n\n    # produce a new set of coefficients where only the 440hz sine wave is\n    # present\n    filtered = sound.mdct.zeros_like()\n    filtered[:, freq_band] = a440\n\n    # apply a geometric scale, which more closely matches human pitch\n    # perception, and apply it to the linear frequency axis\n    scale = zounds.GeometricScale(50, 4000, 0.05, 100)\n    log_coeffs = scale.apply(sound.mdct, zounds.HanningWindowingFunc())\n\n    # reconstruct audio from the MDCT coefficients\n    mdct_synth = zounds.MDCTSynthesizer()\n    reconstructed = mdct_synth.synthesize(sound.mdct)\n    filtered_reconstruction = mdct_synth.synthesize(filtered)\n\n    # start an in-browser REPL that will allow you to listen to and visualize\n    # the variables defined above (and any new ones you create in the session)\n    app = zounds.ZoundsApp(\n        model=Sound,\n        audio_feature=Sound.ogg,\n        visualization_feature=Sound.weighted,\n        globals=globals(),\n        locals=locals())\n    app.start(9999)\n```\n\nFind more inspiration in the [examples folder](https://github.com/JohnVinyard/zounds/tree/master/examples),\nor on the [blog](http://johnvinyard.github.io/).\n\n# Installation\n \n## Libsndfile Issues\nInstallation currently requires you to build lbiflac and libsndfile from source, because of \n[an outstanding issue](https://github.com/bastibe/PySoundFile/issues/130) that will be corrected when the apt package \nis updated to `libsndfile 1.0.26`.  Download and run \n[this script](https://raw.githubusercontent.com/JohnVinyard/zounds/master/setup.sh) to handle this step.\n\n## Numpy and Scipy\nThe [Anaconda](https://www.continuum.io/downloads) python distribution is highly recommended.\n\n## Zounds\nFinally, just:\n\n```bash\npip install zounds\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnvinyard%2Fzounds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnvinyard%2Fzounds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnvinyard%2Fzounds/lists"}