{"id":50030005,"url":"https://github.com/bubustack/livekit-turn-detector-engram","last_synced_at":"2026-05-20T19:51:28.773Z","repository":{"id":352222597,"uuid":"1117423780","full_name":"bubustack/livekit-turn-detector-engram","owner":"bubustack","description":"Turn detector Engram for bobrapet — buffers PCM audio, runs WebRTC VAD, and emits speech turn payloads.","archived":false,"fork":false,"pushed_at":"2026-05-02T07:11:06.000Z","size":76,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-02T09:18:42.571Z","etag":null,"topics":["batch","bubustack","engram","go","kubernetes","livekit","streaming","turn-detection","vad"],"latest_commit_sha":null,"homepage":"https://bubustack.io/","language":"Go","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/bubustack.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"SUPPORT.md","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},"funding":{"github":["bubustack"]}},"created_at":"2025-12-16T09:44:47.000Z","updated_at":"2026-04-28T14:18:45.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bubustack/livekit-turn-detector-engram","commit_stats":null,"previous_names":["bubustack/livekit-turn-detector-engram"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bubustack/livekit-turn-detector-engram","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubustack%2Flivekit-turn-detector-engram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubustack%2Flivekit-turn-detector-engram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubustack%2Flivekit-turn-detector-engram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubustack%2Flivekit-turn-detector-engram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bubustack","download_url":"https://codeload.github.com/bubustack/livekit-turn-detector-engram/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubustack%2Flivekit-turn-detector-engram/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33273387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-20T15:12:43.734Z","status":"ssl_error","status_checked_at":"2026-05-20T15:12:42.300Z","response_time":356,"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":["batch","bubustack","engram","go","kubernetes","livekit","streaming","turn-detection","vad"],"created_at":"2026-05-20T19:51:27.933Z","updated_at":"2026-05-20T19:51:28.769Z","avatar_url":"https://github.com/bubustack.png","language":"Go","funding_links":["https://github.com/sponsors/bubustack"],"categories":[],"sub_categories":[],"readme":"# 🎙️ LiveKit Turn Detector Engram\n\nThis engram buffers the short PCM chunks emitted by the `livekit-bridge-engram` ingress,\nruns WebRTC VAD to detect speech activity, and forwards utterance-sized audio\nturns (by default as WAV files) downstream. It is intended to sit between the\ningress and STT steps so that transcription services receive properly framed\naudio instead of hundreds of 10 ms packets.\n\n## 🌟 Highlights\n\n- Uses the pure-Go WebRTC VAD port (no cgo).\n- Configurable frame size, aggressiveness, silence tail, and min/max turn\n  durations.\n- Emits `speech.vad.active` payloads (the shared Tractatus stream type for VAD turns)\n  that contain a sequence number, duration, and the buffered audio (WAV or PCM).\n\n## 🚀 Quick Start\n\n```bash\nmake lint\ngo test ./...\nmake docker-build\n```\n\nApply `Engram.yaml` and place the turn detector between your ingress audio step\nand downstream STT/VAD consumers.\n\n## ⚙️ Configuration (`Engram.spec.with`)\n\n| Name               | Default | Description |\n|--------------------|---------|-------------|\n| `frameDurationMs`  | `20`    | Frame size fed into the VAD (10/20/30 ms supported). |\n| `silenceDurationMs`| `400`   | Required trailing silence before a turn is closed. |\n| `minDurationMs`    | `200`   | Minimum speech duration for a valid turn. |\n| `maxDurationMs`    | `10000` | Hard cap for a single buffered turn. |\n| `aggressiveness`   | `2`     | WebRTC VAD mode (0 = relaxed, 3 = very aggressive). |\n| `outputEncoding`   | `wav`   | `wav` wraps the PCM chunk in a WAVE header; `pcm` keeps raw PCM16. |\n\n## 📥 Inputs\n\nInput messages must be the `speech.audio.v1` packets emitted by the\ningress engram (PCM16 mono, typically 48 kHz).\n\n## 📤 Outputs\n\nOutput messages have `type=speech.vad.active` and contain the buffered audio\ninline plus metadata about the participant, room, duration, and a\nmonotonically increasing sequence number per speaker.\n\n## 🔄 Streaming Mode\n\n| Stream type | Description |\n|-------------|-------------|\n| `speech.vad.active` | Emitted whenever WebRTC VAD detects a contiguous speech turn. Includes buffered audio. |\n\nDownstream steps can simply filter on the `speech.vad.*` namespace regardless of which\ndetector produced the signal, enabling mix-and-match pipelines.\n\n## 🧪 Local Development\n\n- `make lint` – Run the shared lint and static-analysis checks.\n- `go test ./...` – Run the turn-detector test suite.\n- `make docker-build` – Build the engram image for local clusters.\n- Toggle `BUBU_DEBUG=true` to log sanitized packet summaries and turn boundaries without dumping raw PCM into the logs.\n\n## 🤝 Community \u0026 Support\n\n- [Contributing](./CONTRIBUTING.md)\n- [Support](./SUPPORT.md)\n- [Security Policy](./SECURITY.md)\n- [Code of Conduct](./CODE_OF_CONDUCT.md)\n- [Discord](https://discord.gg/dysrB7D8H6)\n\n\n## 📄 License\n\nCopyright 2025 BubuStack.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbubustack%2Flivekit-turn-detector-engram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbubustack%2Flivekit-turn-detector-engram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbubustack%2Flivekit-turn-detector-engram/lists"}