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)


namestringnilThe name of the microphone that this Microphone will record from, or nil to use the default microphone.
samplesnumber1024The maximum number of samples that will be stored in the Microphone's internal buffer.
sampleRatenumber8000The number of audio samples to record each second.
bitDepthnumber16The number of bits occupied by each sample. Usually 8 or 16.
channelCountnumber1The number of channels to record (1 for mono, 2 for stereo).


microphoneMicrophoneThe new Microphone, or nil if the capture settings are not supported.

See also