{"id":40402391,"url":"https://github.com/baabaaox/go-webrtcvad","last_synced_at":"2026-01-20T13:35:42.205Z","repository":{"id":144211417,"uuid":"263977465","full_name":"baabaaox/go-webrtcvad","owner":"baabaaox","description":"WebRTC Voice Activity Detection for Golang","archived":false,"fork":false,"pushed_at":"2025-02-07T15:59:03.000Z","size":3214,"stargazers_count":42,"open_issues_count":1,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-11-22T13:05:56.857Z","etag":null,"topics":["cgo","go","golang","vad","webrtc","webrtcvad"],"latest_commit_sha":null,"homepage":"","language":"C","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/baabaaox.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}},"created_at":"2020-05-14T17:12:03.000Z","updated_at":"2025-10-21T20:18:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"5471419a-ed59-4675-978f-6a565e787f3e","html_url":"https://github.com/baabaaox/go-webrtcvad","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/baabaaox/go-webrtcvad","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baabaaox%2Fgo-webrtcvad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baabaaox%2Fgo-webrtcvad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baabaaox%2Fgo-webrtcvad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baabaaox%2Fgo-webrtcvad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baabaaox","download_url":"https://codeload.github.com/baabaaox/go-webrtcvad/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baabaaox%2Fgo-webrtcvad/sbom","scorecard":{"id":222233,"data":{"date":"2025-08-11","repo":{"name":"github.com/baabaaox/go-webrtcvad","commit":"ba5be570054f6fe82e513fa7c8ebb8b7a62493c9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Code-Review","score":1,"reason":"Found 1/6 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/go-tests.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go-tests.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/baabaaox/go-webrtcvad/go-tests.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go-tests.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/baabaaox/go-webrtcvad/go-tests.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T02:51:01.192Z","repository_id":144211417,"created_at":"2025-08-17T02:51:01.193Z","updated_at":"2025-08-17T02:51:01.193Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28603817,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T12:01:53.233Z","status":"ssl_error","status_checked_at":"2026-01-20T12:01:46.545Z","response_time":117,"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":["cgo","go","golang","vad","webrtc","webrtcvad"],"created_at":"2026-01-20T13:35:41.672Z","updated_at":"2026-01-20T13:35:42.200Z","avatar_url":"https://github.com/baabaaox.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-webrtcvad\n\n[![Go Tests](https://github.com/baabaaox/go-webrtcvad/actions/workflows/go-tests.yml/badge.svg)](https://github.com/baabaaox/go-webrtcvad/actions/workflows/go-tests.yml)\n\nI have ported VAD from latest WebRTC lkgr at 20250207.\n\nThis project rewrite from [maxhawkins/go-webrtcvad](https://github.com/maxhawkins/go-webrtcvad).\n\nThe WebRTC source code download form [WebRTC lkgr commit [8e55dca89f4e39241f9e3ecd25ab0ebbf5d1ab37]](https://webrtc.googlesource.com/src/+/8e55dca89f4e39241f9e3ecd25ab0ebbf5d1ab37).\n\n## Installation\n\n```shell\ngo get github.com/baabaaox/go-webrtcvad\n```\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"io\"\n\t\"log\"\n\t\"os\"\n\t\"github.com/baabaaox/go-webrtcvad\"\n)\n\nconst (\n\t// VadMode vad mode\n\tVadMode = 0\n\t// SampleRate sample rate\n\tSampleRate = 16000\n\t// BitDepth bit depth\n\tBitDepth = 16\n\t// FrameDuration frame duration\n\tFrameDuration = 20\n)\n\nvar (\n\tframeIndex  = 0\n\tframeSize   = SampleRate / 1000 * FrameDuration\n\tframeBuffer = make([]byte, SampleRate/1000*FrameDuration*BitDepth/8)\n\tframeActive = false\n)\n\nfunc pcm2wav(pcmBuffer []byte, file string) (err error) {\n\twavBuffer := \u0026bytes.Buffer{}\n\t// RIFF chunk\n\twavBuffer.Write([]byte(\"RIFF\"))\n\tbinary.Write(wavBuffer, binary.LittleEndian, uint32(36+len(pcmBuffer)))\n\twavBuffer.Write([]byte(\"WAVE\"))\n\t// fmt chunk\n\twavBuffer.Write([]byte(\"fmt \"))\n\tbinary.Write(wavBuffer, binary.LittleEndian, uint32(16))\n\tbinary.Write(wavBuffer, binary.LittleEndian, uint16(1))\n\tbinary.Write(wavBuffer, binary.LittleEndian, uint16(1))\n\tbinary.Write(wavBuffer, binary.LittleEndian, uint32(16000))\n\tbinary.Write(wavBuffer, binary.LittleEndian, uint32(1*16000*16/8))\n\tbinary.Write(wavBuffer, binary.LittleEndian, uint16(1*16/8))\n\tbinary.Write(wavBuffer, binary.LittleEndian, uint16(16))\n\t// data chunk\n\twavBuffer.Write([]byte(\"data\"))\n\tbinary.Write(wavBuffer, binary.LittleEndian, uint32(len(pcmBuffer)))\n\twavBuffer.Write(pcmBuffer)\n\terr = os.WriteFile(file, wavBuffer.Bytes(), 0777)\n\treturn\n}\n\nfunc main() {\n\t// ffmpeg -y -i test.mp4 -acodec pcm_s16le -f s16le -ac 1 -ar 16000 test.pcm\n\t// ffmpeg -y -i test.mp3 -acodec pcm_s16le -f s16le -ac 1 -ar 16000 test.pcm\n\taudioFile, err := os.Open(\"test.pcm\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer audioFile.Close()\n\tvadInst := webrtcvad.Create()\n\tdefer webrtcvad.Free(vadInst)\n\twebrtcvad.Init(vadInst)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\terr = webrtcvad.SetMode(vadInst, VadMode)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tchunkBuffer := \u0026bytes.Buffer{}\n\tfor {\n\t\t_, err = audioFile.Read(frameBuffer)\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tframeActive, err = webrtcvad.Process(vadInst, SampleRate, frameBuffer, frameSize)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tif frameActive {\n\t\t\tchunkBuffer.Write(frameBuffer)\n\t\t}\n\t\tlog.Printf(\"Frame: %v, Active: %v\", frameIndex, frameActive)\n\t\tframeIndex++\n\t}\n\tpcm2wav(chunkBuffer.Bytes(), \"test.wav\")\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaabaaox%2Fgo-webrtcvad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaabaaox%2Fgo-webrtcvad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaabaaox%2Fgo-webrtcvad/lists"}