pySonic

Recorder class

Records audio data using an audio driver. If the driver supports recording from more than one source, audio is acquired from the source currently set using the driver's configuration utility (e.g. from a microphone in).

Methods

Recorder()

Create a Recorder() object. Only one object of this kind should be used at a time. The behavior of using two recorders at once is unspecified.

list(string, ...) ListDrivers()

Lists the names of the available recording drivers.

Position in the returned list of values corresponds to driver number (e.g. first string is the name of driver zero).

Start(Sample sample, bool loopit)

Start recording into the Sample provided. If loopit is false, recording continues until the buffer is full. If loopit is true, recording continues at the beginning once the buffer is full, overwriting the previous contents.

Stop()

Cease recording immediately.

Properties

int Driver (read, write)

The current audio recording device. Zero is the default input driver on the system. One and higher are other input drivers.

int CurrentSample (read)

The current position in samples of the recording pointer. A value of -1 is returned if recording has not yet started.