{"id":24180052,"url":"https://github.com/xaionaro-go/audio","last_synced_at":"2026-04-10T11:02:19.373Z","repository":{"id":272027398,"uuid":"915305345","full_name":"xaionaro-go/audio","owner":"xaionaro-go","description":"A package for Go to playback, record and process audio ","archived":false,"fork":false,"pushed_at":"2026-02-02T19:58:30.000Z","size":216,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-09T02:38:21.595Z","etag":null,"topics":["android","audio","linux","noise-suppression","oto","pcm","pipewire","playback","portaudio","pulseaudio","rnnoise","sound","voice-activity-detection","windows"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xaionaro-go.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-11T14:05:00.000Z","updated_at":"2026-02-02T19:58:33.000Z","dependencies_parsed_at":"2025-02-09T17:25:26.642Z","dependency_job_id":"5832c648-b6b8-41ed-891f-97d93dff13ae","html_url":"https://github.com/xaionaro-go/audio","commit_stats":null,"previous_names":["xaionaro-go/audio"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xaionaro-go/audio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xaionaro-go%2Faudio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xaionaro-go%2Faudio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xaionaro-go%2Faudio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xaionaro-go%2Faudio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xaionaro-go","download_url":"https://codeload.github.com/xaionaro-go/audio/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xaionaro-go%2Faudio/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31639524,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T07:40:12.752Z","status":"ssl_error","status_checked_at":"2026-04-10T07:40:11.664Z","response_time":98,"last_error":"SSL_read: 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":["android","audio","linux","noise-suppression","oto","pcm","pipewire","playback","portaudio","pulseaudio","rnnoise","sound","voice-activity-detection","windows"],"created_at":"2025-01-13T06:11:38.943Z","updated_at":"2026-04-10T11:02:19.362Z","avatar_url":"https://github.com/xaionaro-go.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `audio`\n\n`audio` is a collection of package to handle audio inputs, outputs and processing in Go.\n\nIt currently supports 3 backends:\n* [`oto`](./pkg/audio/backends/oto) (https://github.com/ebitengine/oto) [for all OSes, but only playback]\n* [`portaudio`](./pkg/audio/backends/portaudio) (https://github.com/gordonklaus/portaudio) [for Windows]\n* [`pulseaudio`](./pkg/audio/backends/pulseaudio) (github.com/jfreymuth/pulse) [for Linux]\n\nAnd it has various modules for audio processing:\n* Basics: [`resampler`](./pkg/audio/resampler), [`planar`](./pkg/audio/planar).\n* [Noise suppression](./pkg/noisesuppression), also in [streaming mode](./pkg/noisesuppressionstream).\n* [Voice Activity Detector](./pkg/vad)\n* For speech processing see also [github.com/xaionaro-go/speech](https://github.com/xaionaro-go/speech).\n\n# Examples\n\n**BEEP** using a vorbis audio file\n```go\nimport (\n\t...\n\n\t\"github.com/xaionaro-go/audio/pkg/audio\"\n\n\t// select the backends you want to use:\n\t_ \"github.com/xaionaro-go/audio/pkg/audio/backends/oto\"\n\t_ \"github.com/xaionaro-go/audio/pkg/audio/backends/portaudio\"\n)\n\n\nfunc beep(...) {\n\t...\n\tplayer := audio.NewPlayerAuto(ctx)\n\tdefer player.Close()\n\tstream, err := player.PlayVorbis(ctx, vorbisReader) // or use PlayPCM if the byte stream is PCM\n\t...\n}\n```\nTo use a specific backend:\n```go\n\tpulsePCMPlayer := pulse.NewPlayerPCM()\n\tplayer := audio.NewPlayer(pulsePCMPlayer)\n\tdefer player.Close()\n\tstream, err := player.PlayVorbis(ctx, vorbisReader)\n```\n\n**RECORD**\n```go\nimport (\n\t...\n\n\t\"github.com/xaionaro-go/audio/pkg/audio\"\n\t_ \"github.com/xaionaro-go/audio/pkg/audio/backends/portaudio\"\n\t_ \"github.com/xaionaro-go/audio/pkg/audio/backends/pulseaudio\"\n)\n\nfunc record5Seconds(ctx context.Context, w io.Writer) {\n\tctx, cancelFn := context.WithCancel(ctx)\n\trecorder := audio.NewRecorderAuto(ctx)\n\tdefer recorder.Close()\n\tstreamRecord, err := recorder.RecordPCM(ctx, 48000, 2, audio.PCMFormatFloat32LE, w)\n\tdefer streamRecord.Close()\n\ttime.Sleep(5 * time.Second)\n\tcancelFn()\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxaionaro-go%2Faudio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxaionaro-go%2Faudio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxaionaro-go%2Faudio/lists"}