{"id":15700818,"url":"https://github.com/linusu/rust-alac-encoder","last_synced_at":"2025-05-12T15:23:49.591Z","repository":{"id":44961452,"uuid":"182960357","full_name":"LinusU/rust-alac-encoder","owner":"LinusU","description":"ALAC Encoder for Rust","archived":false,"fork":false,"pushed_at":"2022-01-15T13:53:47.000Z","size":7044,"stargazers_count":7,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-12T15:23:40.056Z","etag":null,"topics":["alac","encoder","hacktoberfest","rust"],"latest_commit_sha":null,"homepage":"","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/LinusU.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-23T07:35:45.000Z","updated_at":"2024-11-27T01:26:14.000Z","dependencies_parsed_at":"2022-09-26T19:00:50.135Z","dependency_job_id":null,"html_url":"https://github.com/LinusU/rust-alac-encoder","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Frust-alac-encoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Frust-alac-encoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Frust-alac-encoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Frust-alac-encoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LinusU","download_url":"https://codeload.github.com/LinusU/rust-alac-encoder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253764021,"owners_count":21960498,"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":["alac","encoder","hacktoberfest","rust"],"created_at":"2024-10-03T19:54:33.181Z","updated_at":"2025-05-12T15:23:49.533Z","avatar_url":"https://github.com/LinusU.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ALAC Encoder for Rust\n\nRust port of [Apple's open source ALAC library](https://macosforge.github.io/alac/).\n\n## Installation\n\nThis crate works with Cargo and is on [crates.io](https://crates.io/crates/alac-encoder).\n\n## Usage\n\n```rust\nuse alac_encoder::{AlacEncoder, FormatDescription};\n\n// Specify the input format as signed 16-bit raw PCM, 44100 Hz \u0026 2 channels\nlet input_format = FormatDescription::pcm::\u003ci16\u003e(44100.0, 2);\n\n// Specify the output format as 44100 Hz ALAC with a frame size of 4096 \u0026 2 channels\nlet output_format = FormatDescription::alac(44100.0, 4096, 2);\n\n// Initialize the encoder\nlet mut encoder = AlacEncoder::new(\u0026output_format);\n\n// Allocate a buffer for the encoder to write chunks to.\nlet mut output = vec![0u8; output_format.max_packet_size()];\n\n// Get a hold of the source data, e.g. from a file\nlet pcm = fs::read(\"foobar.pcm\").unwrap();\n\n// Iterate over chunks from the input\nfor chunk in pcm.chunks(frame_size as usize * channels as usize * 2) {\n  // Feed the current chunk to the encoder\n  let size = encoder.encode(\u0026input_format, \u0026chunk, \u0026mut output);\n\n  // Here you can do whatever you want with the result:\n  Vec::from(\u0026output[0..size]);\n}\n```\n\n## License\n\nLicensed under either of\n\n* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0))\n* MIT license ([LICENSE-MIT](LICENSE-MIT) or [http://opensource.org/licenses/MIT](http://opensource.org/licenses/MIT))\n\nat your option.\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinusu%2Frust-alac-encoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinusu%2Frust-alac-encoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinusu%2Frust-alac-encoder/lists"}