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

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.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

Gets the length of frame returned by the recorder.


PvRecorder.IsRecording

public bool IsRecording

Gets whether the recorder is currently capturing audio or not.


PvRecorder.SampleRate

public int SampleRate

Gets the recording sample rate.


PvRecorder.SelectedDevice

public string SelectedDevice

Gets the current selected audio device.


PvRecorder.Version

public string Version

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()
  • GetAvailableDevices()
  • Start()
  • Stop()
  • Read()
  • SetDebugLogging()
  • FrameLength
  • IsRecording
  • SampleRate
  • SelectedDevice
  • Version
  • PvRecorderException
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.