{"id":40061838,"url":"https://github.com/braheezy/zigaudio","last_synced_at":"2026-01-19T07:31:10.792Z","repository":{"id":314823968,"uuid":"1052497068","full_name":"braheezy/zigaudio","owner":"braheezy","description":"Zig library for reading and writing different audio formats","archived":false,"fork":false,"pushed_at":"2025-12-23T04:13:42.000Z","size":41990,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-24T19:21:02.657Z","etag":null,"topics":["aac","audio","flac","mp3","ogg","qoa","wav","zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","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/braheezy.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-09-08T06:20:57.000Z","updated_at":"2025-12-23T04:13:45.000Z","dependencies_parsed_at":"2025-10-26T18:35:27.387Z","dependency_job_id":null,"html_url":"https://github.com/braheezy/zigaudio","commit_stats":null,"previous_names":["braheezy/zigaudio"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/braheezy/zigaudio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/braheezy%2Fzigaudio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/braheezy%2Fzigaudio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/braheezy%2Fzigaudio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/braheezy%2Fzigaudio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/braheezy","download_url":"https://codeload.github.com/braheezy/zigaudio/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/braheezy%2Fzigaudio/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28562993,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T03:31:16.861Z","status":"ssl_error","status_checked_at":"2026-01-19T03:31:15.069Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["aac","audio","flac","mp3","ogg","qoa","wav","zig"],"created_at":"2026-01-19T07:31:10.739Z","updated_at":"2026-01-19T07:31:10.787Z","avatar_url":"https://github.com/braheezy.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zigaudio\n\nA Zig library for reading and writing audio files with a streaming-capable, format-agnostic API.\n\n## Audio Format Support\n\n| Format | Read | Write | Notes |\n|--------|------|-------|-------|\n| QOA    | ✅   | ✅    | Full support |\n| WAV    | ✅   | ✅    | Write: i16 PCM only |\n| MP3    | ✅   | ❌    | |\n| AAC    | ✅   | ❌    | Not pure Zig (`faad2`) |\n| FLAC   | ✅   | ❌    | |\n| OGG    | ✅   | ❌    | Vorbis streams |\n\n**Note:** All formats decode to i16 PCM. WAV encoding supports i16 PCM output only.\n\n### WAV Format Support\n\nWAV decoding supports a wide range of sub-formats:\n\n- **PCM**: 8, 16, 24, 32-bit (including WAVE_FORMAT_EXTENSIBLE)\n- **IEEE Float**: 32-bit (single) and 64-bit (double)\n- **G.711**: mu-Law and a-Law\n- **ADPCM**: IMA ADPCM and MS ADPCM\n\nAll the files from [this site](https://mauvecloud.net/sounds/).\n\n## Usage\n\nAdd to your `build.zig.zon`:\n\n```bash\nzig fetch --save git+https://github.com/braheezy/zig-audio#0.1.0\n```\n\nAnd in your `build.zig`:\n\n```zig\nconst zigaudio = b.dependency(\"zigaudio\", .{});\nroot_module.addImport(\"zigaudio\", zigaudio.module(\"zigaudio\"));\n```\n\n## Quick Start\n\n```zig\nconst std = @import(\"std\");\nconst zigaudio = @import(\"zigaudio\");\n\npub fn main() !void {\n    const allocator = std.heap.page_allocator;\n\n    // Simple: decode entire file (good for small files)\n    var audio = try zigaudio.decodeFile(allocator, \"song.mp3\");\n    defer audio.deinit(allocator);\n\n    std.debug.print(\"Sample rate: {d} Hz\\n\", .{audio.params.sample_rate});\n    std.debug.print(\"Channels: {d}\\n\", .{audio.params.channels});\n    std.debug.print(\"Duration: {d:.2}s\\n\", .{audio.durationSeconds()});\n\n    // Work with PCM samples (interleaved i16: [L, R, L, R, ...])\n    const pcm_samples = audio.samples();\n    for (pcm_samples[0..@min(10, pcm_samples.len)]) |sample| {\n        std.debug.print(\"Sample: {d}\\n\", .{sample});\n    }\n\n    // For large files: stream and process incrementally\n    const stream = try zigaudio.fromPath(allocator, \"large-song.mp3\");\n    defer stream.deinit(allocator);\n\n    var buffer: [4096]i16 = undefined;\n    while (true) {\n        const samples_read = try stream.read(\u0026buffer);\n        if (samples_read == 0) break;\n        // Process samples in chunks (send to audio output, DSP, etc.)\n    }\n}\n```\n\n### Format Conversion\n\n```zig\nvar audio = try zigaudio.decodeFile(allocator, \"input.mp3\");\ndefer audio.deinit(allocator);\n\n// Encode to QOA or WAV\ntry zigaudio.encodeToPath(.qoa, \"output.qoa\", \u0026audio);\ntry zigaudio.encodeToPath(.wav, \"output.wav\", \u0026audio);\n```\n\n### Embedded Audio\n\n```zig\nconst embedded_audio = @embedFile(\"sound.qoa\");\n\n// Decode from embedded bytes\nvar audio = try zigaudio.decodeMemory(allocator, embedded_audio);\ndefer audio.deinit(allocator);\n```\n\n## Examples\n\nThe `examples/` directory contains:\n\n- **`player/`**: Audio playback using the `zoto` library\n- **`bench/`**: Performance benchmarking tools\n- **`convert/`**: Decode one format, write another.\n\n## Building and Running\n\n```bash\n# Build the library (compiles but doesn't install examples)\nzig build\n\n# Run tests\nzig build test\n\n# See help for all\nzig build --help\n```\n\n## Contributing\n\nPlease do! Open an Issue, PR, new audio format, all is welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbraheezy%2Fzigaudio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbraheezy%2Fzigaudio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbraheezy%2Fzigaudio/lists"}