PvRecorder
.NET API
API Reference for the PvRecorder .NET SDK (NuGet)
namespace: Pv
PvRecorder
Class for PvRecorder.
PvRecorder.Create()
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 sizeframe_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()
Frees memory used by the PvRecorder
instance.
PvRecorder.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()
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()
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()
Synchronously reads a frame of audio samples. Call between Start()
and Stop()
.
Returns
short[]
: An array of audio samples with length offrameLength
that was provided upon initialization.
Throws
PvRecorderException
: If an error occurs while reading audio data.
PvRecorder.SetDebugLogging()
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 offrameLength
that was provided upon initialization.
PvRecorder.FrameLength
Gets the length of frame returned by the recorder.
PvRecorder.IsRecording
Gets whether the recorder is currently capturing audio or not.
PvRecorder.SampleRate
Gets the recording sample rate.
PvRecorder.SelectedDevice
Gets the current selected audio device.
PvRecorder.Version
Gets the current version of the library.
PvRecorderException
Exception thrown if an error occurs within PvRecorder
.
Exceptions: