Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAudioDevices ¶
GetAudioDevices function gets the currently available input audio devices.
Types ¶
type PvRecorder ¶
type PvRecorder struct { // Index of audio device to start recording and capture audio. DeviceIndex int // FrameLength to get for each read command. FrameLength int // BufferSizeMSec is the total amount of audio frames to store in milliseconds. BufferSizeMSec int // LogOverflow flag to enable logs when a buffer overflow occurs. LogOverflow int // LogSilence flag to enable logs when continuous audio buffers are detected as silent. LogSilence int // contains filtered or unexported fields }
PvRecorder struct
func (*PvRecorder) Delete ¶
func (pvrecorder *PvRecorder) Delete()
Delete function releases resources acquired by PvRecorder
func (*PvRecorder) GetSelectedDevice ¶
func (pvrecorder *PvRecorder) GetSelectedDevice() string
GetSelectedDevice gets the current selected audio input device name
func (*PvRecorder) Read ¶
func (pvrecorder *PvRecorder) Read() ([]int16, error)
Read function reads audio frames.
func (*PvRecorder) Start ¶
func (pvrecorder *PvRecorder) Start() error
Start function starts recording audio.
func (*PvRecorder) Stop ¶
func (pvrecorder *PvRecorder) Stop() error
Stop function stops recording audio.
type PvRecorderStatus ¶
type PvRecorderStatus int
PvRecorderStatus type
const ( SUCCESS PvRecorderStatus = 0 OUT_OF_MEMORY PvRecorderStatus = 1 INVALID_ARGUMENT PvRecorderStatus = 2 INVALID_STATE PvRecorderStatus = 3 BACKEND_ERROR PvRecorderStatus = 4 DEVICE_ALREADY_INITIALIZED PvRecorderStatus = 5 DEVICE_NOT_INITIALIZED PvRecorderStatus = 6 IO_ERROR PvRecorderStatus = 7 RUNTIME_ERROR PvRecorderStatus = 8 )
PvRecorder status return codes from C library
Click to show internal directories.
Click to hide internal directories.