Picovoice Wordmark
Start Building
Introduction
Introduction
AndroidC.NETFlutterlink to GoiOSJavaNVIDIA JetsonLinuxmacOSNodejsPythonRaspberry PiReact NativeRustWebWindows
AndroidC.NETFlutterlink to GoiOSJavaNodejsPythonReact NativeRustWeb
SummaryPicovoice LeopardAmazon TranscribeAzure Speech-to-TextGoogle ASRGoogle ASR (Enhanced)IBM Watson Speech-to-Text
FAQ
Introduction
AndroidC.NETFlutterlink to GoiOSJavaNVIDIA JetsonLinuxmacOSNodejsPythonRaspberry PiReact NativeRustWebWindows
AndroidC.NETFlutterlink to GoiOSJavaNodejsPythonReact NativeRustWeb
FAQ
Introduction
AndroidCiOSLinuxmacOSPythonWebWindows
AndroidCiOSPythonWeb
SummaryOctopus Speech-to-IndexGoogle Speech-to-TextMozilla DeepSpeech
FAQ
Introduction
AndroidAngularArduinoBeagleBoneCChrome.NETEdgeFirefoxFlutterlink to GoiOSJavaNVIDIA JetsonLinuxmacOSMicrocontrollerNodejsPythonRaspberry PiReactReact NativeRustSafariUnityVueWebWindows
AndroidAngularC.NETFlutterlink to GoiOSJavaMicrocontrollerNodejsPythonReactReact NativeRustUnityVueWeb
SummaryPorcupineSnowboyPocketSphinx
Wake Word TipsFAQ
Introduction
AndroidAngularBeagleBoneCChrome.NETEdgeFirefoxFlutterlink to GoiOSJavaNVIDIA JetsonLinuxmacOSNodejsPythonRaspberry PiReactReact NativeRustSafariUnityVueWebWindows
AndroidAngularC.NETFlutterlink to GoiOSJavaNodejsPythonReactReact NativeRustUnityVueWeb
SummaryPicovoice RhinoGoogle DialogflowAmazon LexIBM WatsonMicrosoft LUIS
Expression SyntaxFAQ
Introduction
AndroidBeagleboneCiOSNVIDIA JetsonLinuxmacOSPythonRaspberry PiRustWebWindows
AndroidCiOSPythonRustWeb
SummaryPicovoice CobraWebRTC VAD
FAQ
Introduction
AndroidCiOSNVIDIA JetsonLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice KoalaMozilla RNNoise
Introduction
AndroidCiOSNVIDIA JetsonLinuxmacOSPythonRaspberry PiWebWindows
AndroidCPythoniOSWeb
Introduction
AndroidAngularArduinoBeagleBoneC.NETFlutterlink to GoiOSJavaNVIDIA JetsonMicrocontrollerNodejsPythonRaspberry PiReactReact NativeRustUnityVueWeb
AndroidAngularCMicrocontroller.NETFlutterlink to GoiOSJavaNodejsPythonReactReact NativeRustUnityVueWeb
Picovoice SDK - FAQ
IntroductionSTM32F407G-DISC1 (Arm Cortex-M4)STM32F411E-DISCO (Arm Cortex-M4)STM32F769I-DISCO (Arm Cortex-M7)IMXRT1050-EVKB (Arm Cortex-M7)
Introduction
AndroidC.NETFlutterlink to GoiOSNodejsPythonReact NativeRustUnityWeb
AndroidC.NETFlutterlink to GoiOSNodejsPythonReact NativeRustUnityWeb
FAQGlossary

Audio Recording
Unity Quick Start

Platforms

  • Linux (x86_64)
  • macOS (x86_64, arm64)
  • Windows (x86_64)
  • Android (5.0+, API 21+) (ARM only)
  • iOS (11.0+)

Requirements

  • Unity 2017.4+ (Unity 2021.2+ for macOS arm64)
  • Unity Build Support modules for desired platforms

Quick Start

Setup

  1. Download and install Unity .

  2. Clone the unity-voice-processor GitHub repo :

git clone https://github.com/Picovoice/unity-voice-processor.git
  1. Add Unity Voice Processor package to the project by clicking on Assets > Import Package.

Usage

Access the singleton instance of VoiceProcessor:

using Pv.Unity;
VoiceProcessor voiceProcessor = VoiceProcessor.Instance;

Create and add listeners for audio frames:

void onFrameCaptured(short[] frame) {
// use audio data
}
voiceProcessor.AddFrameListener(onFrameCaptured);

Start audio capture with the desired frame length and audio sample rate:

readonly int frameLength = 512;
readonly int sampleRate = 16000;
voiceProcessor.StartRecording(frameLength, sampleRate);

Stop audio capture:

voiceProcessor.StopRecording();

Once audio capture has started successfully, any frame listeners assigned to the VoiceProcessor will start receiving audio frames with the given frameLength and sampleRate.

Capturing with Multiple Listeners

Any number of listeners can be added to and removed from the VoiceProcessor instance. However, the instance can only record audio with a single audio configuration (frameLength and sampleRate), which all listeners will receive once a call to StartRecording() has been made. To add multiple listeners:

void OnFrameCaptured1(short[] frame) { }
void OnFrameCaptured2(short[] frame) { }
VoiceProcessorFrameListener[] listeners = new VoiceProcessorFrameListener[] {
OnFrameCaptured1, OnFrameCaptured2
};
voiceProcessor.AddFrameListeners(listeners);
voiceProcessor.RemoveFrameListeners(listeners);
// or
voiceProcessor.ClearFrameListeners();

Demo

For the Voice Processor Unity SDK we have an example app that demonstrates how to use VoiceProcessor in an Unity app.

Setup

Clone the unity-voice-processor repository from GitHub:

git clone https://github.com/Picovoice/unity-voice-processor.git

Usage

  1. Open the Unity Voice Processor project via Unity.

  2. Open the VoiceProcessorDemo.unity scene located in Assets/UnityVoiceProcessor/Demo .

  3. Run the scene in the editor or build and run it on one of the supported platforms.

  4. Start and stop recording with the space bar. The shape on the screen will grow proportional to how loud the input audio is.

For more information on our Voice Processor demo for Unity, head over to our GitHub repository .

Resources

Package

  • Pv.Unity.VoiceProcessor on GitHub

API

  • unity-voice-processor API Docs

GitHub

  • Voice Processor Unity SDK on GitHub
  • Voice Processor Unity Demo on GitHub

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Audio Recording Unity Quick Start
  • Platforms
  • Requirements
  • Quick Start
  • Setup
  • Usage
  • Capturing with Multiple Listeners
  • Demo
  • Setup
  • Usage
  • Resources
Platform
  • Leopard Speech-to-Text
  • Cheetah Streaming Speech-to-Text
  • Koala Noise Suppression
  • Eagle Speaker RecognitionBETA
  • Octopus Speech-to-Index
  • Porcupine Wake Word
  • Rhino Speech-to-Intent
  • Cobra Voice Activity Detection
  • Orca Text-to-SpeechWAITLIST
  • Falcon Speaker DiarizationWAITLIST
Resources
  • Docs
  • Console
  • Blog
  • Use Cases
Sales & Services
  • Consulting
  • Developer Plan
  • Enterprise Plan
  • Support Add-on
Company
  • About us
  • Careers
Follow Picovoice
  • LinkedIn
  • GitHub
  • Twitter
  • Medium
  • YouTube
  • AngelList
Subscribe to our newsletter
Terms of Use
Privacy Policy
© 2019-2022 Picovoice Inc.