RecordingDevice:start

Available since LÖVE 11.0
This function is not supported in earlier versions.

Begins recording audio using this device.

Function

Synopsis

success = RecordingDevice:start( samplecount, samplerate, bitdepth, channels )

Arguments

number samplecount
The maximum number of samples to store in an internal ring buffer when recording. RecordingDevice:getData clears the internal buffer when called.
number samplerate (8000)
The number of samples per second to store when recording.
number bitdepth (16)
The number of bits per sample.
number channels (1)
Whether to record in mono or stereo. Most microphones don't support more than 1 channel.

Returns

boolean success
True if the device successfully began recording using the specified parameters, false if not.

Notes

A ring buffer is used internally to store recorded data before RecordingDevice:getData or RecordingDevice:stop are called – the former clears the buffer. If the buffer completely fills up before getData or stop are called, the oldest data that doesn't fit into the buffer will be lost.

See Also

Other Languages