Picovoice Wordmark
Start Building
Introduction
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryPicovoice picoLLMGPTQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustWeb
SummaryPicovoice LeopardAmazon TranscribeAzure Speech-to-TextGoogle ASRGoogle ASR (Enhanced)IBM Watson Speech-to-TextWhisper Speech-to-Text
FAQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustWeb
SummaryPicovoice Cheetah
FAQ
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryAmazon PollyAzure TTSElevenLabsOpenAI TTSPicovoice Orca
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice KoalaMozilla RNNoise
Introduction
AndroidCiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidCNode.jsPythoniOSWeb
SummaryPicovoice EaglepyannoteSpeechBrainWeSpeaker
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice FalconAmazon TranscribeAzure Speech-to-TextGoogle Speech-to-Textpyannote
Introduction
AndroidArduinoCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSMicrocontrollerNode.jsPythonRaspberry PiReactReact NativeRustSafariUnityWebWindows
AndroidC.NETFlutteriOSJavaMicrocontrollerNode.jsPythonReactReact NativeRustUnityWeb
SummaryPorcupineSnowboyPocketSphinx
Wake Word TipsFAQ
Introduction
AndroidCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustSafariUnityWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustUnityWeb
SummaryPicovoice RhinoGoogle DialogflowAmazon LexIBM WatsonMicrosoft LUIS
Expression SyntaxFAQ
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiRustWebWindows
AndroidC.NETiOSNode.jsPythonRustWeb
SummaryPicovoice CobraWebRTC VAD
FAQ
Introduction
AndroidC.NETFlutteriOSNode.jsPythonReact NativeRustUnityWeb
AndroidC.NETFlutteriOSNode.jsPythonReact NativeRustUnityWeb
Introduction
C.NETNode.jsPython
C.NETNode.jsPython
FAQGlossary

PvRecorder
.NET API

API Reference for the PvRecorder .NET SDK (NuGet)


namespace: Pv


PvRecorder

public class PvRecorder : IDisposable { }

Class for PvRecorder.


PvRecorder.Create()

public static PvRecorder Create(
int frameLength,
int deviceIndex = -1,
int bufferedFramesCount = 50)

Factory method for creating instances of PvRecorder.

Parameters

  • frameLength int : Length of the audio frame to receive with each call to read.
  • deviceIndex int : The index of the audio device to capture audio with. A value of (-1) will use the default audio device.
  • bufferedFramesCount int : The number of audio frames buffered internally for reading - i.e. internal circular buffer will be of size frame_length * buffered_frames_count. If this value is too low, buffer overflows could occur and audio frames could be dropped. A higher value will increase memory usage.

Returns

  • PvRecorder: An instance of PvRecorder.

Throws

  • PvRecorderException: If an error occurs while creating an instance of PvRecorder.

PvRecorder.Dispose()

public void PvRecorder Dispose()

Frees memory used by the PvRecorder instance.


PvRecorder.GetAvailableDevices()

public static string[] GetAvailableDevices()

Gets a list of the available audio input devices on the current system.

Returns

  • string[]: An array of strings containing the names of the audio devices.

Throws

  • PvRecorderException: If an error occurs while getting audio device info.

PvRecorder.Start()

public void Start()

Starts recording audio. Should be called before making any calls to Read() or Stop().

Throws

  • PvRecorderException: If an error occurs while starting audio device.

PvRecorder.Stop()

public void Stop()

Stops recording audio. Should only be called after a successful call to Start().

Throws

  • PvRecorderException: If an error occurs while stopping audio device.

PvRecorder.Read()

public short[] Read()

Synchronously reads a frame of audio samples. Call between Start() and Stop().

Returns

  • short[]: An array of audio samples with length of frameLength that was provided upon initialization.

Throws

  • PvRecorderException: If an error occurs while reading audio data.

PvRecorder.SetDebugLogging()

public void SetDebugLogging(bool isDebugLoggingEnabled)

Enable or disable debug logging. Debug logs will indicate when there are overflows in the internal frame buffer and when an audio source is generating frames of silence.

Parameters

  • isDebugLoggingEnabled bool : Boolean indicating whether the debug logging is enabled or disabled.

Returns

  • short[]: An array of audio samples with length of frameLength that was provided upon initialization.

PvRecorder.FrameLength

public int FrameLength { get; private set; }

Gets the length of frame returned by the recorder.


PvRecorder.IsRecording

public bool IsRecording { get; }

Gets whether the recorder is currently capturing audio or not.


PvRecorder.SampleRate

public int SampleRate { get; private set; }

Gets the recording sample rate.


PvRecorder.SelectedDevice

public string SelectedDevice { get; private set; }

Gets the current selected audio device.


PvRecorder.Version

public string Version { get; private set; }

Gets the current version of the library.


PvRecorderException

public class PvRecorderException : Exception { }

Exception thrown if an error occurs within PvRecorder.

Exceptions:

public class PvRecorderMemoryException : PvRecorderException { }
public class PvRecorderInvalidArgumentException : PvRecorderException { }
public class PvRecorderInvalidStateException : PvRecorderException { }
public class PvRecorderBackendException : PvRecorderException { }
public class PvRecorderDeviceAlreadyInitializedException : PvRecorderException { }
public class PvRecorderDeviceNotInitializedException : PvRecorderException { }
public class PvRecorderIOException : PvRecorderException { }
public class PvRecorderRuntimeException : PvRecorderException { }

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
PvRecorder .NET API
  • PvRecorder
  • Create()
  • Dispose()
  • GetAvailableDevices()
  • Start()
  • Stop()
  • Read()
  • SetDebugLogging()
  • FrameLength
  • IsRecording
  • SampleRate
  • SelectedDevice
  • Version
  • PvRecorderException
Voice AI
  • Leopard Speech-to-Text
  • Cheetah Streaming Speech-to-Text
  • Orca Text-to-Speech
  • Koala Noise Suppression
  • Eagle Speaker Recognition
  • Falcon Speaker Diarization
  • Porcupine Wake Word
  • Rhino Speech-to-Intent
  • Cobra Voice Activity Detection
Local LLM
  • picoLLM Inference
  • picoLLM Compression
  • picoLLM GYM
Resources
  • Docs
  • Console
  • Blog
  • Use Cases
  • Playground
Sales & Services
  • Consulting
  • Foundation Plan
  • Enterprise Plan
  • Enterprise Support
Company
  • About us
  • Careers
Follow Picovoice
  • LinkedIn
  • GitHub
  • X
  • YouTube
  • AngelList
Subscribe to our newsletter
Terms of Use
Privacy Policy
© 2019-2025 Picovoice Inc.