{"id":33922806,"url":"https://github.com/capdilla/audiotee_rust","last_synced_at":"2025-12-12T09:13:04.763Z","repository":{"id":328042785,"uuid":"1089907076","full_name":"capdilla/audiotee_rust","owner":"capdilla","description":"A Rust library for capturing system audio output on macOS using the audiotee binary. This library provides a convenient wrapper around the command-line tool, making it easy to capture, process, and save system audio in your Rust applications.","archived":false,"fork":false,"pushed_at":"2025-11-05T01:23:28.000Z","size":193,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-11T08:10:21.085Z","etag":null,"topics":["macos","rust-lang","system-audio-capture"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/capdilla.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-05T01:15:33.000Z","updated_at":"2025-11-05T15:19:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/capdilla/audiotee_rust","commit_stats":null,"previous_names":["capdilla/audiotee_rust"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/capdilla/audiotee_rust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capdilla%2Faudiotee_rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capdilla%2Faudiotee_rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capdilla%2Faudiotee_rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capdilla%2Faudiotee_rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/capdilla","download_url":"https://codeload.github.com/capdilla/audiotee_rust/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capdilla%2Faudiotee_rust/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27679874,"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","status":"online","status_checked_at":"2025-12-12T02:00:06.775Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["macos","rust-lang","system-audio-capture"],"created_at":"2025-12-12T09:13:01.575Z","updated_at":"2025-12-12T09:13:04.756Z","avatar_url":"https://github.com/capdilla.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# audiotee\n\n[![Crates.io](https://img.shields.io/crates/v/audiotee.svg)](https://crates.io/crates/audiotee)\n[![Documentation](https://docs.rs/audiotee/badge.svg)](https://docs.rs/audiotee)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA Rust library for capturing system audio output on macOS using the `audiotee` binary. This library provides a convenient wrapper around the command-line tool, making it easy to capture, process, and save system audio in your Rust applications.\n\n## Features\n\n- **Real-time audio capture**: Capture system audio output as PCM data streams\n- **Event-driven API**: React to audio data, start/stop events, and errors through callbacks\n- **Configurable parameters**: Control sample rate, chunk duration, and process filtering\n- **WAV file export**: Built-in support for saving captured audio as WAV files\n- **Thread-safe**: Safe to use in multi-threaded applications\n- **macOS only**: Specifically designed for macOS system audio capture\n\n## Installation\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\naudiotee = \"0.1.0\"\n```\n\n### Prerequisites\n\n- **macOS**: This library only works on macOS\n- **audiotee binary**: The `audiotee` command-line tool must be installed and accessible in your PATH\n- **Rust**: 1.70 or later\n\n## Usage\n\n```rust\nuse audiotee::{AudioTee, AudioTeeOptions};\nuse std::sync::{Arc, Mutex};\n\nfn main() {\n    // Configure options\n    let options = AudioTeeOptions {\n        sample_rate: Some(16_000),\n        chunk_duration_ms: Some(1000),\n        mute: Some(false),\n        include_processes: None,\n        exclude_processes: None,\n    };\n\n    // Buffer to accumulate audio data\n    let audio_buffer: Arc\u003cMutex\u003cVec\u003cu8\u003e\u003e\u003e = Arc::new(Mutex::new(Vec::new()));\n    let audio_buffer_clone = Arc::clone(\u0026audio_buffer);\n\n    // Create AudioTee instance with event handlers\n    let mut tee = AudioTee::new(options)\n        .on_start(|| println!(\"Started capturing audio\"))\n        .on_stop(|| println!(\"Stopped capturing audio\"))\n        .on_error(|e| eprintln!(\"Error: {e}\"))\n        .on_data(move |chunk| {\n            let mut buffer = audio_buffer_clone.lock().unwrap();\n            buffer.extend_from_slice(\u0026chunk.data);\n        });\n\n    // Start capturing\n    tee.start().expect(\"Failed to start AudioTee\");\n\n    // Capture for some time...\n    std::thread::sleep(std::time::Duration::from_secs(10));\n\n    // Stop capturing\n    tee.stop().expect(\"Failed to stop AudioTee\");\n}\n```\n\n## Configuration Options\n\nThe `AudioTeeOptions` struct allows you to customize the audio capture behavior:\n\n- **`sample_rate`**: Sample rate in Hz (e.g., `16000`, `44100`, `48000`)\n- **`chunk_duration_ms`**: Duration of each audio chunk in milliseconds\n- **`mute`**: Whether to mute system audio output during capture\n- **`include_processes`**: List of process IDs to include in capture (whitelist)\n- **`exclude_processes`**: List of process IDs to exclude from capture (blacklist)\n\n## Examples\n\nCheck out the [examples](examples/) directory for more comprehensive usage examples:\n\n```bash\ncargo run --example main\n```\n\nThis will demonstrate:\n- Starting and stopping audio capture\n- Saving audio chunks periodically\n- Exporting captured audio as WAV files\n\n## Platform Support\n\n| Platform | Supported |\n|----------|-----------|\n| macOS    | ✅ Yes    |\n| Linux    | ❌ No     |\n| Windows  | ❌ No     |\n\n## Credits\n\nThis library is built on top of the [`audiotee`](https://github.com/makeusabrew/audiotee) command-line tool. Special thanks to [Nick Payne](https://github.com/makeusabrew) and his excellent article: [AudioTee: Capture System Audio Output on macOS](https://stronglytyped.uk/articles/audiotee-capture-system-audio-output-macos).\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapdilla%2Faudiotee_rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcapdilla%2Faudiotee_rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapdilla%2Faudiotee_rust/lists"}