Creates a new Microphone based on the name of an existing micrphone and a set of capture parameters. If the specified parameters are not supported, nil will be returned.

microphone = lovr.audio.newMicrophone(name, samples, sampleRate, bitDepth, channelCount)


namestringThe name of the microphone that this Microphone will record from.
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