Picovoice Wordmark
Start Free
Introduction
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryPicovoice picoLLMGPTQ
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeWeb
SummaryPicovoice LeopardAmazon TranscribeAzure Speech-to-TextGoogle ASRGoogle ASR (Enhanced)IBM Watson Speech-to-TextWhisper Speech-to-Text
FAQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeWeb
SummaryPicovoice CheetahAzure Real-Time Speech-to-TextAmazon Transcribe StreamingGoogle Streaming ASRMoonshine StreamingVosk StreamingWhisper.cpp Streaming
FAQ
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryAmazon PollyAzure TTSElevenLabsOpenAI TTSPicovoice OrcaChatterbox-TTS-TurboKokoro-TTSKitten-TTS-Nano-0.8-INT8Pocket-TTSNeu-TTS-Nano-Q4-GGUFPiper-TTSSoprano-TTSSupertonic-TTS-2ESpeak-NG
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice KoalaMozilla RNNoise
Introduction
AndroidCiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidCNode.jsPythoniOSWeb
SummaryPicovoice EaglepyannoteSpeechBrain
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice FalconAmazon TranscribeAzure Speech-to-TextGoogle Speech-to-Textpyannote
Introduction
AndroidArduinoCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSMicrocontrollerNode.jsPythonRaspberry PiReactReact NativeSafariWebWindows
AndroidC.NETFlutteriOSJavaMicrocontrollerNode.jsPythonReactReact NativeWeb
SummaryPicovoice PorcupineSnowboyPocketSphinx
Wake Word TipsFAQ
Introduction
AndroidArduinoCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSMicrocontrollerNode.jsPythonRaspberry PiReactReact NativeSafariWebWindows
AndroidC.NETFlutteriOSJavaMicrocontrollerNode.jsPythonReactReact NativeWeb
SummaryPicovoice RhinoGoogle DialogflowAmazon LexIBM WatsonMicrosoft LUIS
Expression SyntaxFAQ
Introduction
AndroidArduinoC.NETiOSLinuxmacOSMicrocontrollerNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSMicrocontrollerNode.jsPythonWeb
SummaryPicovoice CobraWebRTC VADSilero VAD
FAQ
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
Introduction
AndroidC.NETFlutteriOSNode.jsPythonReact NativeWeb
AndroidC.NETFlutteriOSNode.jsPythonReact NativeWeb
Introduction
C.NETNode.jsPython
C.NETNode.jsPython
FAQGlossary

Audio Recording
.NET Quick Start

Platforms

  • Linux (x86_64)
  • macOS (x86_64, arm64)
  • Windows (x86_64, arm64)
  • Raspberry Pi (3, 4, 5)

Requirements

.NET Framework 4.6.1+ / .NET Standard 2.0+ / .NET Core 3.0+:

  • Windows (x86_64)

.NET Standard 2.0+ / .NET Core 3.0+:

  • macOS (x86_64)

.NET 6.0+:

  • macOS (arm64)
  • Windows (arm64)
  • Linux (x86_64)
  • Raspberry Pi (3, 4, 5)

Quick Start

Setup

  1. Install .NET.

  2. Install the PvRecorder NuGet package in Visual Studio or using the .NET CLI:

dotnet add package PvRecorder

Usage

Initialize and begin recording:

using Pv;
PvRecorder recorder = PvRecorder.Create(frameLength: 512);
recorder.Start();

Read a frame of audio:

while (true) {
short[] frame = recorder.Read();
// do something with audio frame
}

To stop recording:

recorder.Stop();

Once you are done, free the used resources. You do not have to call Stop() before Dispose():

recorder.Dispose();

To have resources freed immediately after use without explicitly calling Dispose(), wrap PvRecorder in a using statement:

using (PvRecorder recorder = PvRecorder.Create(frameLength: 512)) {
// PvRecorder usage
}

Selecting an Audio Device

To print a list of available audio devices:

string[] devices = PvRecorder.GetAvailableDevices();

The index of the device in the returned list can be used in Create() to select that device for audio capture:

PvRecorder recorder = PvRecorder.Create(
frameLength: 512,
deviceIndex: 2);

Demo

For the PvRecorder .NET SDK, we offer a demo application that demonstrates how use PvRecorder to record audio to an output audio file.

Setup

  1. Clone the repository:
git clone --recurse-submodules https://github.com/Picovoice/pvrecorder.git
  1. Build the project:
cd pvrecorder/demo/dotnet
dotnet build

Usage

To show the available audio devices run:

dotnet run -- --show_audio_devices

To run the demo, give it a file to record audio to:

dotnet run -- --output_wav_path ${OUTPUT_WAV_FILE}

You can also select the audio device index to use for recording (use --show_audio_devices to see options):

dotnet run -- --output_wav_path ${OUTPUT_WAV_FILE} --audio_device_index ${DEVICE_INDEX}

For more information about our PvRecorder demo, head over to our GitHub repository.

Resources

Package

  • PvRecorder on NuGet

API

  • PvRecorder .NET API Docs

GitHub

  • PvRecorder .NET SDK on GitHub
  • PvRecorder .NET Demo on GitHub

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Audio Recording .NET Quick Start
  • Platforms
  • Requirements
  • Quick Start
  • Setup
  • Usage
  • Selecting an Audio Device
  • Demo
  • Setup
  • Usage
  • Resources
© 2019-2026 Picovoice Inc.PrivacyTerms