lovr.audio.newMicrophone
Creates a new Microphone based on the name of an existing micrphone and a set of capture parameters. If the specified combination of prameters are not supported for audio capture, nil
will be returned.
microphone = lovr.audio.newMicrophone(name, samples, sampleRate, bitDepth, channelCount)
Arguments
Name | Type | Default | Description |
name | string | nil | The name of the microphone that this Microphone will record from, or nil to use the default microphone.
|
samples | number | 1024 | The maximum number of samples that will be stored in the Microphone's internal buffer.
|
sampleRate | number | 8000 | The number of audio samples to record each second.
|
bitDepth | number | 16 | The number of bits occupied by each sample. Usually 8 or 16.
|
channelCount | number | 1 | The number of channels to record (1 for mono, 2 for stereo).
|
Returns
Name | Type | Description |
microphone | Microphone | The new Microphone, or nil if the capture settings are not supported.
|
See also
lovr.audio.getMicrophoneNames
Microphone
lovr.audio