porcupine
Operate Picovoice Porcupine wake-word detection across Python, Node.js, Web, mobile, managed SDK, C, and embedded workflows.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- porcupine
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Operate Picovoice Porcupine wake-word detection across Python, Node.js, Web, mobile, managed SDK, C, and embedded workflows.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/compatibility-and-assets.md4.0 KB
- 参考文档references/repo-provenance.md3.8 KB
- 参考文档references/repo-routing-metadata.json323 B
- 参考文档references/troubleshooting.md4.8 KB
- 脚本scripts/check_porcupine_install.py2.2 KB
03 SKILL.md 正文
Porcupine
Use this repo skill when a task involves Picovoice Porcupine wake-word detection, custom keyword assets, SDK integration, file or microphone wake-word loops, device selection, or Porcupine platform troubleshooting.
Porcupine detects one or more static wake phrases from 16-bit PCM audio. Most detection workflows need a Picovoice AccessKey at engine initialization; safe package/import/device checks usually do not.
Start here
- Read
references/compatibility-and-assets.mdto identify the SDK family, audio contract, AccessKey boundary, and asset/platform vocabulary. - Run
scripts/check_porcupine_install.py --helpwhen the task starts with a Python install/import/device check. - Route to the narrow sub-skill below for API details, recipes, scripts, and workflow-specific troubleshooting.
- Use
references/troubleshooting.mdfor cross-cutting AccessKey, asset, audio-frame, package, and backend failures. - Use
references/repo-provenance.mdbefore deciding whether this generated skill is stale for a checkout.
Install and safe Python smoke
For Python tasks:
pip install pvporcupine
python - <<'PY'
import pvporcupine
print(sorted(pvporcupine.KEYWORDS)[:10])
print(pvporcupine.available_devices())
PY
Or run the bundled safe helper:
python scripts/check_porcupine_install.py
Detection and training still require a valid AccessKey.
Route by task
| Task | Read |
|---|---|
Python API, pvporcupine.create, Porcupine.process, file WAV checks, Python exceptions, Python device enumeration |
sub-skills/python-and-cli/SKILL.md |
Node.js server-side JavaScript/TypeScript, @picovoice/porcupine-node, native .node loading, Int16Array frame loops |
sub-skills/nodejs-server/SKILL.md |
Browser/WebAssembly, @picovoice/porcupine-web, React usePorcupine, WASM workers, public-path/base64 assets, browser microphone permissions |
sub-skills/web-and-react/SKILL.md |
| Java, Android, iOS Swift, .NET, Flutter, React Native package selection, manager-vs-engine APIs, app permissions, lifecycle and callbacks | sub-skills/managed-and-mobile-sdks/SKILL.md |
Built-in keyword inventory, non-English .pv models, custom .ppn platform matching, training API, AccessKey/network/quota boundaries |
sub-skills/custom-keywords-and-assets/SKILL.md |
| C API, headers/libraries, linker/load issues, file/mic C recipes, MCU/STM32 static asset embedding | sub-skills/c-and-embedded/SKILL.md |
Cross-cutting operating rules
- Keep AccessKeys out of generated code, logs, and committed files.
- Choose built-in keywords only when the phrase is exposed by the target SDK/platform; otherwise use explicit custom
.ppnpaths. - Pair custom/non-English keyword files with the matching platform and language model.
- Feed exact
frame_length/frameLengthframes atsample_rate/sampleRate; buffer or resample before callingprocess. - Use manager APIs for platform microphone callbacks; use low-level engines when the caller owns PCM frames.
- Stop recorders/managers before deleting/releasing Porcupine.
- Treat microphone, browser, mobile, MCU, network training, and AccessKey-backed native detections as optional verification unless the user explicitly supplies the required resources.
Bundled helpers
scripts/check_porcupine_install.py: safe Python import/asset/device check, no AccessKey.sub-skills/python-and-cli/scripts/porcupine_file_check.py: Python WAV-file checker;--helpand--list-devicesare safe, detection needs AccessKey.sub-skills/nodejs-server/scripts/porcupine_node_file_template.js: Node.js file-processing template/helper.sub-skills/c-and-embedded/scripts/porcupine_binary_to_c_array.py: convert.ppn,.pv, or other binary assets to C arrays for embedded workflows.sub-skills/web-and-react/scripts/web_asset_manifest_template.json: template for planning browser public-path/base64 assets.
Verification notes
The generated skill was drafted from repository docs/source/tests and a verified Python inspection environment for pvporcupine 4.0.3. Safe checks verified import, package metadata, built-in keyword enumeration, library/model path existence, and available_devices() on Linux. Credentialed detections, training requests, browser/mobile UI tests, and MCU board runs remain optional because they require AccessKeys, network, devices, or platform build stacks.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).