Difference between revisions of "Microphone"
From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>") |
|||
(One intermediate revision by the same user not shown) | |||
Line 8: | Line 8: | ||
=== Example === | === Example === | ||
− | < | + | <syntaxhighlight lang="lua"> |
require "microphone" | require "microphone" | ||
Line 28: | Line 28: | ||
end | end | ||
--recordStop:addEventListener(Event.CLICK, onRecordStop) | --recordStop:addEventListener(Event.CLICK, onRecordStop) | ||
− | </ | + | </syntaxhighlight> |
{|- | {|- |
Latest revision as of 15:30, 13 July 2023
Supported platforms:
Available since: Gideros 2013.06
Description
Use this plugin to record to an audio clip using a connected microphone.
Example
require "microphone"
local microphone = Microphone.new(nil, 22050, 1, 16)
microphone:addEventListener(Event.DATA_AVAILABLE, function(event)
print(event.peakAmplitude)
end)
microphone:setOutputFile("|D|record.wav")
local function onRecord()
microphone:start()
end
--record:addEventListener(Event.CLICK, onRecord)
local function onRecordStop()
microphone:stop()
end
--recordStop:addEventListener(Event.CLICK, onRecordStop)
MethodsMicrophone.new creates a new Microphone object |
EventsConstants |