{"id":21423902,"url":"https://github.com/picovoice/pvrecorder","last_synced_at":"2025-04-10T01:08:43.093Z","repository":{"id":37072574,"uuid":"397404967","full_name":"Picovoice/pvrecorder","owner":"Picovoice","description":"Cross-platform audio recorder designed for real-time speech audio processing","archived":false,"fork":false,"pushed_at":"2025-04-09T19:32:16.000Z","size":42779,"stargazers_count":106,"open_issues_count":1,"forks_count":23,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-10T01:08:35.061Z","etag":null,"topics":["audio","c","dotnet","golang","nodejs","python","rust","voice"],"latest_commit_sha":null,"homepage":"","language":"C","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/Picovoice.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}},"created_at":"2021-08-17T22:20:40.000Z","updated_at":"2025-04-04T21:25:06.000Z","dependencies_parsed_at":"2024-06-18T20:05:20.842Z","dependency_job_id":"c104f108-2f72-40d3-9f8e-a3da77029644","html_url":"https://github.com/Picovoice/pvrecorder","commit_stats":{"total_commits":214,"total_committers":10,"mean_commits":21.4,"dds":"0.32242990654205606","last_synced_commit":"7179b3d3937f71b3e40dac151fabc3c3c988d9c7"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Picovoice%2Fpvrecorder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Picovoice%2Fpvrecorder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Picovoice%2Fpvrecorder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Picovoice%2Fpvrecorder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Picovoice","download_url":"https://codeload.github.com/Picovoice/pvrecorder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137887,"owners_count":21053775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["audio","c","dotnet","golang","nodejs","python","rust","voice"],"created_at":"2024-11-22T21:18:51.912Z","updated_at":"2025-04-10T01:08:43.072Z","avatar_url":"https://github.com/Picovoice.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PvRecorder\n\n[![GitHub release](https://img.shields.io/github/release/Picovoice/pvrecorder.svg)](https://github.com/Picovoice/pvrecorder/releases)\n[![GitHub](https://img.shields.io/github/license/Picovoice/pvrecorder)](https://github.com/Picovoice/pvrecorder/)\n\n\u003c!-- markdown-link-check-disable --\u003e\n[![PyPI](https://img.shields.io/pypi/v/pvrecorder)](https://pypi.org/project/pvrecorder/)\n[![Nuget](https://img.shields.io/nuget/v/pvrecorder)](https://www.nuget.org/packages/pvrecorder/)\n[![npm](https://img.shields.io/npm/v/@picovoice/pvrecorder-node?label=npm%20%5Bnode%5D)](https://www.npmjs.com/package/@picovoice/pvrecorder-node)\n[![Crates.io](https://img.shields.io/crates/v/pv_recorder)](https://crates.io/crates/pv_recorder)\n\u003c!-- markdown-link-check-enable --\u003e\n\nMade in Vancouver, Canada by [Picovoice](https://picovoice.ai)\n\n\u003c!-- markdown-link-check-disable --\u003e\n[![Twitter URL](https://img.shields.io/twitter/url?label=%40AiPicovoice\u0026style=social\u0026url=https%3A%2F%2Ftwitter.com%2FAiPicovoice)](https://twitter.com/AiPicovoice)\n\u003c!-- markdown-link-check-enable --\u003e\n[![YouTube Channel Views](https://img.shields.io/youtube/channel/views/UCAdi9sTCXLosG1XeqDwLx7w?label=YouTube\u0026style=social)](https://www.youtube.com/channel/UCAdi9sTCXLosG1XeqDwLx7w)\n\nPvRecorder is an easy-to-use, cross-platform audio recorder designed for real-time speech audio processing. It allows developers access to an audio device's input stream, broken up into data frames of a given size.\n\n## Table of Contents\n- [PvRecorder](#pvrecorder)\n  - [Table of Contents](#table-of-contents)\n  - [Source Code](#source-code)\n  - [Demos](#demos)\n    - [Python](#python-demo)\n    - [.NET](#net-demo)\n    - [Node.js](#nodejs-demo)\n    - [Rust](#rust-demo)\n    - [C](#c-demo)\n  - [SDKs](#sdks)\n    - [Python](#python)\n    - [.NET](#net)\n    - [Node.js](#nodejs)\n    - [Rust](#rust)\n\n## Source Code\n\nIf you are interested in building PvRecorder from source or integrating it into an existing C project, the PvRecorder\nsource code is located under the [/project](./project) directory.\n\n## Demos\n\nIf using SSH, clone the repository with:\n\n```console\ngit clone --recurse-submodules git@github.com:Picovoice/pvrecorder.git\n```\n\nIf using HTTPS, clone the repository with:\n\n```console\ngit clone --recurse-submodules https://github.com/Picovoice/pvrecorder.git\n```\n\n### Python Demo\n\nInstall the demo package:\n\n```console\npip3 install pvrecorderdemo\n```\n\nTo show the available audio devices run:\n\n```console\npv_recorder_demo --show_audio_devices\n```\n\nWith a working microphone connected to your device run the following in the terminal:\n\n```console\npv_recorder_demo --output_wav_path {OUTPUT_WAV_PATH}\n```\n\nReplace `{OUTPUT_WAV_PATH}` with the path to save the audio data in `wav` format.\n\nFor more information about the Python demos go to [demo/python](demo/python).\n\n\n### .NET Demo\n\nFrom [demo/dotnet/PvRecorderDemo](demo/dotnet/PvRecorderDemo) run the\nfollowing in the terminal to build the demo:\n\n```console\ndotnet build\n```\n\nMake sure there is a working microphone connected to your device. From [demo/dotnet/PvRecorderDemo](demo/dotnet/PvRecorderDemo) run the\nfollowing in the terminal:\n\n```console\ndotnet run -- --output_wav_path ${OUTPUT_WAV_PATH}\n```\n\nFor more information about the .NET demo, go to [demo/dotnet](demo/dotnet).\n\n### Node.js Demo\n\nInstall the demo package:\n\n```console\nyarn global add @picovoice/pvrecorder-node-demo\n```\n\nWith a working microphone connected to your device run the following in the terminal:\n\n```console\npvrecorder-node-demo --output_wav_path ${OUTPUT_WAV_PATH}\n```\n\nReplace `{OUTPUT_WAV_PATH}` with the file path to save the audio data in `wav` format.\n\nFor more information about NodeJS demo, go to [demo/nodejs](demo/nodejs/).\n\n### Rust Demo\n\nMake sure there is a working microphone connected to your device. From [demo/rust/](demo/rust) run the following in the terminal to build and run the demo:\n\n```console\ncargo run --release -- --output_wav_path ${OUTPUT_WAV_PATH}\n```\n\nFor more information about the Rust demo, go to [demo/rust](demo/rust).\n\n### C Demo\n\nRun the following commands to build the demo app:\n\n```console\ncd demo/c\ncmake -S . -B build -DPV_RECORDER_PLATFORM={PV_RECORDER_PLATFORM}\ncmake --build build\n```\n\nThe `{PV_RECORDER_PLATFORM}` variable will set the compilation flags for the given platform. Exclude this variable\nto get a list of possible values.\n\nGet a list of available audio recording devices:\n```console\n./pv_recorder_demo --show_audio_devices\n```\n\nRecord to a file with a given audio device index:\n```console\n./pv_recorder_demo -o test.wav -d 2\n```\n\nHit `Ctrl+C` to stop recording. If no audio device index (`-d`) is provided, the demo will use the system's default recording device.\n\nFor more information about the C demo, go to [demo/c](demo/c).\n\n## SDKs\n\n### Python\n\nTo start recording, initialize an instance and run `start()`:\n\n```python\nfrom pvrecorder import PvRecorder\n\nrecorder = PvRecorder(frame_length=512)\nrecorder.start()\n```\n\nRead frames of audio:\n\n```python\nwhile recorder.is_recording:\n    frame = recorder.read()\n    # process audio frame\n```\n\nTo stop recording, run `stop()` on the instance:\n\n```python\nrecorder.stop()\n```\n\nOnce you are done, free the resources acquired by PvRecorder. You do not have to call `stop()` before `delete()`:\n\n```python\nrecorder.delete()\n```\n\nFor more information about the PvRecorder Python SDK, go to [binding/python](binding/python).\n\n### .NET\n\nInstall the .NET SDK using NuGet or the dotnet CLI:\n\n```console\ndotnet add package PvRecorder\n```\n\nInitialize and begin recording:\n\n```csharp\nusing Pv;\n\nPvRecorder recorder = PvRecorder.Create(frameLength: 512);\nrecorder.Start();\n```\n\nRead frames of audio:\n\n```csharp\nwhile (recorder.IsRecording)\n{\n    short[] frame = recorder.Read();\n    // process audio frame\n}\n```\n\nTo stop recording:\n\n```csharp\nrecorder.Stop();\n```\n\nOnce you are done, free the resources acquired by PvRecorder. You do not have to call `Stop()` before `Dispose()`:\n\n```csharp\nrecorder.Dispose();\n```\n\nFor more information about the PvRecorder .NET SDK, go to [binding/dotnet](binding/dotnet).\n\n### Node.js\n\nInstall Node.js binding:\n\n```console\nyarn add @picovoice/pvrecorder-node\n```\n\nTo start recording, initialize the instance and run `start()`:\n\n```javascript\nconst frameLength = 512;\nconst recorder = new PvRecorder(frameLength);\nrecorder.start()\n```\n\nRead frames of audio:\n\n```javascript\nwhile (recorder.isRecording) {\n    const frame = await recorder.read();\n    // process audio frame\n}\n```\n\nTo stop recording, call `stop()` on the instance:\n\n```javascript\nrecorder.stop();\n```\n\nOnce you are done, free the resources acquired by PvRecorder. You do not have to call `stop()` before `release()`:\n\n```javascript\nrecorder.release();\n```\n\nFor more information about the PvRecorder Node.js SDK, go to [binding/nodejs](binding/nodejs).\n\n### Rust\n\nAdd `pv_recorder` to your app's `Cargo.toml` manifest:\n\n```toml\n[dependencies]\npv_recorder = \"*\"\n```\n\nTo start recording, initialize the instance and run `start()`:\n\n```rust\nuse pv_recorder::PvRecorderBuilder\n\nlet frame_length = 512;\nlet recorder = PvRecorderBuilder::new(frame_length).init()?;\nrecorder.start()?;\n```\n\nRead frames of audio:\n\n```rust\nwhile recorder.is_recording() {\n    let frame = recorder.read()?;\n    // process audio frame\n}\n```\n\nTo stop recording, run `stop()` on the instance:\n\n```rust\nrecorder.stop()?;\n```\n\nFor more information about the PvRecorder Rust SDK, go to [binding/rust](binding/rust).\n\n## Releases\n\n### v1.2.0 - July 13th, 2023\n\n- API improvements\n- Improved docs\n- Added unit tests and actions for each SDK\n- Addressed race condition when stop is called during a read\n- Fixed .NET version support\n- Demos write to WAV files\n\n### v1.1.0 - November 10th, 2022\n\n- Added logs that warn users if recorded audio is silent for a few number of seconds.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpicovoice%2Fpvrecorder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpicovoice%2Fpvrecorder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpicovoice%2Fpvrecorder/lists"}