{"id":21423954,"url":"https://github.com/picovoice/unity-voice-processor","last_synced_at":"2025-04-19T14:43:39.712Z","repository":{"id":55004402,"uuid":"330032650","full_name":"Picovoice/unity-voice-processor","owner":"Picovoice","description":"Unity audio recording package designed for real-time speech audio processing","archived":false,"fork":false,"pushed_at":"2023-08-25T23:43:59.000Z","size":176,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-29T08:51:06.319Z","etag":null,"topics":["android","audio","audio-processing","audio-recorder","csharp","ios","linux","macos","unity","windows"],"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":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":"2021-01-15T22:06:49.000Z","updated_at":"2025-03-24T15:46:12.000Z","dependencies_parsed_at":"2025-01-23T07:13:13.058Z","dependency_job_id":"d6dbdf88-f0cb-4486-b133-f01a9c4af30d","html_url":"https://github.com/Picovoice/unity-voice-processor","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Picovoice%2Funity-voice-processor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Picovoice%2Funity-voice-processor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Picovoice%2Funity-voice-processor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Picovoice%2Funity-voice-processor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Picovoice","download_url":"https://codeload.github.com/Picovoice/unity-voice-processor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249716736,"owners_count":21315068,"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":["android","audio","audio-processing","audio-recorder","csharp","ios","linux","macos","unity","windows"],"created_at":"2024-11-22T21:19:00.966Z","updated_at":"2025-04-19T14:43:39.684Z","avatar_url":"https://github.com/Picovoice.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unity Voice Processor\r\n\r\n[![GitHub release](https://img.shields.io/github/release/Picovoice/unity-voice-processor.svg)](https://github.com/Picovoice/unity-voice-processor/releases)\r\n[![GitHub](https://img.shields.io/github/license/Picovoice/unity-voice-processor)](https://github.com/Picovoice/unity-voice-processor/)\r\n\r\nMade in Vancouver, Canada by [Picovoice](https://picovoice.ai)\r\n\r\n\u003c!-- markdown-link-check-disable --\u003e\r\n[![Twitter URL](https://img.shields.io/twitter/url?label=%40AiPicovoice\u0026style=social\u0026url=https%3A%2F%2Ftwitter.com%2FAiPicovoice)](https://twitter.com/AiPicovoice)\r\n\u003c!-- markdown-link-check-enable --\u003e\r\n[![YouTube Channel Views](https://img.shields.io/youtube/channel/views/UCAdi9sTCXLosG1XeqDwLx7w?label=YouTube\u0026style=social)](https://www.youtube.com/channel/UCAdi9sTCXLosG1XeqDwLx7w)\r\n\r\nThe Unity Voice Processor is an asynchronous audio capture library designed for real-time audio\r\nprocessing. Given some specifications, the library delivers frames of raw audio data to the user via\r\nlisteners.\r\n\r\n## Table of Contents\r\n\r\n- [Unity Voice Processor](#unity-voice-processor)\r\n    - [Table of Contents](#table-of-contents)\r\n    - [Compatibility](#compatibility)\r\n    - [Requirements](#requirements)\r\n    - [Installation](#installation)\r\n    - [Usage](#usage)\r\n        - [Capturing with Multiple Listeners](#capturing-with-multiple-listeners)\r\n    - [Demo](#demo)\r\n\r\n## Compatibility\r\n\r\n[`Unity Voice Processor` package](./unity-voice-processor-1.0.0.unitypackage) unity package is for on **Unity 2017.4+** on the following platforms:\r\n\r\n- Android 5.0+ (API 21+) (ARM only)\r\n- iOS 11.0+\r\n- Windows (x86_64)\r\n- macOS (x86_64, arm64)\r\n- Linux (x86_64)\r\n\r\n## Requirements\r\n\r\n- Unity 2017.4+\r\n- Unity Build Support modules for desired platforms\r\n\r\n## Installation\r\n\r\nThe easiest way to install the `Unity Voice Processor` is to import [unity-voice-processor-1.0.0.unitypackage](./unity-voice-processor-1.0.0.unitypackage) into your Unity projects by either dropping it into the Unity editor or going to _Assets\u003eImport Package\u003eCustom Package..._\r\n\r\n## Usage\r\n\r\nAccess the singleton instance of `VoiceProcessor`:\r\n\r\n```csharp\r\nusing Pv.Unity;\r\n\r\nVoiceProcessor voiceProcessor = VoiceProcessor.Instance;\r\n```\r\n\r\nCreate and add listeners for audio frames:\r\n\r\n```csharp\r\nvoid onFrameCaptured(short[] frame) {\r\n    // use audio data\r\n}\r\n\r\nvoiceProcessor.AddFrameListener(onFrameCaptured);\r\n```\r\n\r\nStart audio capture with the desired frame length and audio sample rate:\r\n\r\n```csharp\r\nreadonly int frameLength = 512;\r\nreadonly int sampleRate = 16000;\r\n\r\nvoiceProcessor.StartRecording(frameLength, sampleRate);\r\n```\r\n\r\nStop audio capture:\r\n```csharp\r\nvoiceProcessor.StopRecording();\r\n```\r\n\r\nOnce audio capture has started successfully, any frame listeners assigned to the `VoiceProcessor`\r\nwill start receiving audio frames with the given `frameLength` and `sampleRate`.\r\n\r\n### Capturing with Multiple Listeners\r\n\r\nAny number of listeners can be added to and removed from the `VoiceProcessor` instance. However,\r\nthe instance can only record audio with a single audio configuration (`frameLength` and `sampleRate`),\r\nwhich all listeners will receive once a call to `start()` has been made. To add multiple listeners:\r\n```csharp\r\nvoid OnFrameCaptured1(short[] frame) { }\r\nvoid OnFrameCaptured2(short[] frame) { }\r\n\r\nVoiceProcessorFrameListener[] listeners = new VoiceProcessorFrameListener[] {\r\n        OnFrameCaptured1, OnFrameCaptured2 \r\n};\r\n\r\nvoiceProcessor.AddFrameListeners(listeners);\r\n\r\nvoiceProcessor.RemoveFrameListeners(listeners);\r\n// or\r\nvoiceProcessor.ClearFrameListeners();\r\n```\r\n\r\n## Demo\r\n\r\nThe [Unity Voice Processor Demo](./Assets/UnityVoiceProcessor/Demo/) demonstrates how to ask for user permissions and capture output from\r\nthe `Unity Voice Processor`.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpicovoice%2Funity-voice-processor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpicovoice%2Funity-voice-processor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpicovoice%2Funity-voice-processor/lists"}