Microphone: Difference between revisions
From GiderosMobile
wip |
No edit summary |
||
| Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
<!-- GIDEROSOBJ:Microphone --> | <!-- GIDEROSOBJ:Microphone --> | ||
{{PLATFORMS ALL}} | |||
'''Available since:''' Gideros 2013.06<br/> | '''Available since:''' Gideros 2013.06<br/> | ||
| Line 46: | Line 46: | ||
[[Microphone:start]] ''starts mic recording''<br/><!--GIDEROSMTD:Microphone:start() starts mic recording--> | [[Microphone:start]] ''starts mic recording''<br/><!--GIDEROSMTD:Microphone:start() starts mic recording--> | ||
[[Microphone:stop]] ''stops mic recording''<br/><!--GIDEROSMTD:Microphone:stop() stops mic recording--> | [[Microphone:stop]] ''stops mic recording''<br/><!--GIDEROSMTD:Microphone:stop() stops mic recording--> | ||
[[Microphone:writeAudio]] ''writes microphone output to buffer''<br/><!--GIDEROSMTD:Microphone:writeAudio(buffer) writes microphone output to buffer--> | |||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
Latest revision as of 21:14, 11 October 2026
Supported platforms: ![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
Available since: Gideros 2013.06
Description
Use this plugin to record to an audio clip using a connected microphone.
require "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 Microphone:getDeviceList lists available mics |
EventsConstants |