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
C API

API Reference for the PvRecorder C SDK.


pv_recorder_t

typedef struct pv_recorder pv_recorder_t;

Struct representing the PvRecorder object.


pv_recorder_init()

pv_recorder_status_t pv_recorder_init(
int32_t frame_length,
int32_t device_index,
int32_t buffered_frames_count,
pv_recorder_t **object);

Creates a PvRecorder instance. When finished with the instance, resources should be cleaned up using the pv_recorder_delete() function.

Parameters

  • frame_length int32_t : The length of audio frame to get for each read call.
  • device_index int32_t : The index of the audio device to use. A value of (-1) will resort to default device.
  • buffered_frames_count int32_t : 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.
  • object pv_recorder_t * * : PvRecorder object to be initialized.

Returns

  • pv_recorder_status_t : Returned status code.

pv_recorder_delete()

pv_recorder_status_t pv_recorder_delete(pv_recorder_t *object);

Releases resources acquired by PvRecorder.

Parameters

  • object pv_recorder_t * : PvRecorder object.

pv_recorder_start()

pv_recorder_status_t pv_recorder_start(pv_recorder_t *object);

Starts recording and buffering audio frames.

Parameters

  • object pv_recorder_t * : PvRecorder object.

Returns

  • pv_recorder_status_t : Returned status code.

pv_recorder_stop()

pv_recorder_status_t pv_recorder_stop(pv_recorder_t *object);

Stops recording audio.

Parameters

  • object pv_recorder_t * : PvRecorder object.

Returns

  • pv_recorder_status_t : Returned status code.

pv_recorder_read()

pv_recorder_status_t pv_recorder_read(pv_recorder_t *object, int16_t *pcm);

Synchronous call to read frames. Copies amount of frames to frame array provided to input. Array size must match the frame_length value that was given to pv_recorder_init().

Parameters

  • object pv_recorder_t * : PvRecorder object.
  • frame int16_t * : An array for the audio frame to be copied to.

Returns

  • pv_recorder_status_t : Returned status code.

pv_recorder_set_debug_logging()

void pv_recorder_set_debug_logging(
pv_recorder_t *object,
bool is_debug_logging_enabled);

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

Parameters

  • object pv_recorder_t * : PvRecorder object.
  • is_debug_logging_enabled bool : Boolean indicating whether the debug logging is enabled or disabled.

pv_recorder_get_is_recording()

bool pv_recorder_get_is_recording(pv_recorder_t *object);

Gets whether the given instance of pv_recorder_t is currently capturing audio or not.

Parameters

  • object pv_recorder_t * : PvRecorder object.

Returns

  • bool : A boolean indicating whether the object is recording or not.

pv_recorder_get_selected_device()

const char *pv_recorder_get_selected_device(pv_recorder_t *object);

Gets the audio device that the given pv_recorder_t instance is using.

Parameters

  • object pv_recorder_t * : PvRecorder object.

Returns

  • const char * : A string containing the name of the device.

pv_recorder_get_available_devices()

pv_recorder_status_t pv_recorder_get_available_devices(
int32_t *device_list_length,
char ***device_list);

Gets the list of available audio devices that can be used for recording. Free the returned device_list array using pv_recorder_free_available_devices().

Parameters

  • device_list_length int32_t * : The number of available audio devices.
  • device_list char * * * : The output array containing the list of available audio devices.

Returns

  • pv_recorder_status_t : Returned status code.

pv_recorder_free_available_devices()

void pv_recorder_free_available_devices(
int32_t device_list_length,
char **device_list);

Frees the device list initialized by pv_recorder_get_available_devices().

Parameters

  • device_list_length int32_t : The number of audio devices.
  • device_list char * * : The array containing the list of audio devices.

pv_recorder_status_to_string()

const char *pv_recorder_status_to_string(pv_recorder_status_t status);

Provides string representations of the given status code.

Parameters

  • status pv_recorder_status_t : Status code.

Returns

  • const char * : String representation of the status code.

pv_recorder_sample_rate()

int32_t pv_recorder_sample_rate(void);

Gets the audio sample rate used by PvRecorder.

Returns

  • int32_t : Sample rate.

pv_recorder_version()

const char *pv_recorder_version(void);

Getter for the PvRecorder version.

Returns

  • const char * : Version string.

pv_recorder_status_t

typedef enum {
PV_RECORDER_STATUS_SUCCESS = 0,
PV_RECORDER_STATUS_OUT_OF_MEMORY,
PV_RECORDER_STATUS_INVALID_ARGUMENT,
PV_RECORDER_STATUS_INVALID_STATE,
PV_RECORDER_STATUS_BACKEND_ERROR,
PV_RECORDER_STATUS_DEVICE_ALREADY_INITIALIZED,
PV_RECORDER_STATUS_DEVICE_NOT_INITIALIZED,
PV_RECORDER_STATUS_IO_ERROR,
PV_RECORDER_STATUS_RUNTIME_ERROR
} pv_recorder_status_t;

Status code enum.

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
PvRecorder C API
  • pv_recorder_t
  • pv_recorder_init()
  • pv_recorder_delete()
  • pv_recorder_start()
  • pv_recorder_stop()
  • pv_recorder_read()
  • pv_recorder_set_debug_logging()
  • pv_recorder_get_is_recording()
  • pv_recorder_get_selected_device()
  • pv_recorder_get_available_devices()
  • pv_recorder_free_available_devices()
  • pv_recorder_status_to_string()
  • pv_recorder_sample_rate()
  • pv_recorder_version()
  • pv_recorder_status_t
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.