Microphone:getData

Returns a new SoundData with all of the buffered audio samples that the Microphone has recorded.

channels = Microphone:getData()

Arguments

None

Returns

NameTypeDescription
channelsnumberThe number of channels recorded.

Notes

There's a limit on the number of samples the Microphone is able to hold, which can be set at creation time in lovr.audio.newMicrophone. While the Microphone is recording, be sure to call this function periodically to get a new chunk of audio in order to make room for more.

You can use Microphone:getSampleCount to figure out how many samples the Microphone is currently holding.

See also