{"id":13603592,"url":"https://github.com/ruuda/hound","last_synced_at":"2025-05-15T04:08:01.134Z","repository":{"id":29671363,"uuid":"33213607","full_name":"ruuda/hound","owner":"ruuda","description":"A wav encoding and decoding library in Rust","archived":false,"fork":false,"pushed_at":"2025-04-17T19:52:35.000Z","size":447,"stargazers_count":532,"open_issues_count":39,"forks_count":68,"subscribers_count":7,"default_branch":"release","last_synced_at":"2025-05-15T01:39:01.245Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://codeberg.org/ruuda/hound","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ruuda.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":"contributing.md","funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-03-31T22:29:12.000Z","updated_at":"2025-05-13T22:26:01.000Z","dependencies_parsed_at":"2025-04-14T05:09:56.177Z","dependency_job_id":"b0a50972-b011-4e51-82ee-ec9e74b2ca11","html_url":"https://github.com/ruuda/hound","commit_stats":{"total_commits":333,"total_committers":16,"mean_commits":20.8125,"dds":0.1711711711711712,"last_synced_commit":"553be969556bb148da97dc0364786f1dae62b4ae"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruuda%2Fhound","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruuda%2Fhound/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruuda%2Fhound/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruuda%2Fhound/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruuda","download_url":"https://codeload.github.com/ruuda/hound/tar.gz/refs/heads/release","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254270656,"owners_count":22042860,"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":[],"created_at":"2024-08-01T19:00:26.296Z","updated_at":"2025-05-15T04:07:56.114Z","avatar_url":"https://github.com/ruuda.png","language":"Rust","funding_links":[],"categories":["Rust","Libraries"],"sub_categories":["Audio","Audio and Music"],"readme":"Hound\n=====\nA wav encoding and decoding library in Rust.\n\n[![Crates.io version][crate-img]][crate]\n[![Changelog][changelog-img]](changelog.md)\n[![Documentation][docs-img]][docs]\n\nHound can read and write the WAVE audio format, an ubiquitous format for raw,\nuncompressed audio. The main motivation to write it was to test\n[Claxon][claxon], a FLAC decoding library written in Rust.\n\nExamples\n--------\nThe following example renders a 440 Hz sine wave, and stores it as a mono wav\nfile with a sample rate of 44.1 kHz and 16 bits per sample.\n\n```rust\nuse std::f32::consts::PI;\nuse std::i16;\nuse hound;\n\nlet spec = hound::WavSpec {\n    channels: 1,\n    sample_rate: 44100,\n    bits_per_sample: 16,\n    sample_format: hound::SampleFormat::Int,\n};\nlet mut writer = hound::WavWriter::create(\"sine.wav\", spec).unwrap();\nfor t in (0 .. 44100).map(|x| x as f32 / 44100.0) {\n    let sample = (t * 440.0 * 2.0 * PI).sin();\n    let amplitude = i16::MAX as f32;\n    writer.write_sample((sample * amplitude) as i16).unwrap();\n}\n```\n\nThe file is finalized implicitly when the writer is dropped, call\n`writer.finalize()` to observe errors.\n\nThe following example computes the root mean square (RMS) of an audio file with\nat most 16 bits per sample.\n\n```rust\nuse hound;\n\nlet mut reader = hound::WavReader::open(\"testsamples/pop.wav\").unwrap();\nlet sqr_sum = reader.samples::\u003ci16\u003e()\n                    .fold(0.0, |sqr_sum, s| {\n    let sample = s.unwrap() as f64;\n    sqr_sum + sample * sample\n});\nprintln!(\"RMS is {}\", (sqr_sum / reader.len() as f64).sqrt());\n```\n\nFeatures\n--------\n\n|                 | Read                                                    | Write                                   |\n|-----------------|---------------------------------------------------------|-----------------------------------------|\n| Format          | `PCMWAVEFORMAT`, `WAVEFORMATEX`, `WAVEFORMATEXTENSIBLE` | `PCMWAVEFORMAT`, `WAVEFORMATEXTENSIBLE` |\n| Encoding        | Integer PCM, IEEE Float                                 | Integer PCM, IEEE Float                 |\n| Bits per sample | 8, 16, 24, 32 (integer), 32 (float)                     | 8, 16, 24, 32 (integer), 32 (float)     |\n\nContributing\n------------\nContributions in the form of bug reports, feature requests, or pull requests are\nwelcome. See [contributing.md](contributing.md).\n\nLicense\n-------\nHound is licensed under the [Apache 2.0][apache2] license. It may be used in\nfree software as well as closed-source applications, both for commercial and\nnon-commercial use under the conditions given in the license. If you want to\nuse Hound in your GPLv2-licensed software, you can add an [exception][exception]\nto your copyright notice. Please do not open an issue if you disagree with the\nchoice of license.\n\n[crate-img]:     https://img.shields.io/crates/v/hound.svg\n[crate]:         https://crates.io/crates/hound\n[changelog-img]: https://img.shields.io/badge/changelog-online-blue.svg\n[docs-img]:      https://img.shields.io/badge/docs-online-blue.svg\n[docs]:          https://docs.rs/hound\n[claxon]:        https://github.com/ruuda/claxon\n[apache2]:       https://www.apache.org/licenses/LICENSE-2.0\n[exception]:     https://www.gnu.org/licenses/gpl-faq.html#GPLIncompatibleLibs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruuda%2Fhound","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruuda%2Fhound","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruuda%2Fhound/lists"}