Difference between revisions of "RecordingDevice:start"

(Created page)
 
m
Line 7: Line 7:
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
{{param|number|samplecount|The maximum number of samples to store in an internal ring buffer when recording. [[RecordingDevice:getData|getData]] clears the internal buffer when called.}}
+
{{param|number|samplecount|The maximum number of samples to store in an internal ring buffer when recording. [[RecordingDevice:getData]] clears the internal buffer when called.}}
 
{{param|number|samplerate (8000)|The number of samples per second to store when recording.}}
 
{{param|number|samplerate (8000)|The number of samples per second to store when recording.}}
 
{{param|number|bitdepth (16)|The number of bits per sample.}}
 
{{param|number|bitdepth (16)|The number of bits per sample.}}

Revision as of 00:59, 19 March 2018

Available since LÖVE 0.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