Microphone: Difference between revisions
From GiderosMobile
No edit summary |
wip |
||
| Line 6: | Line 6: | ||
=== Description === | === Description === | ||
Use this plugin to record to an audio clip using a connected microphone. | Use this plugin to record to an audio clip using a connected microphone. | ||
<syntaxhighlight lang="lua"> | |||
require "microphone" | |||
</syntaxhighlight> | |||
=== Example === | === Example === | ||
| Line 35: | Line 38: | ||
[[Microphone.new]] ''creates a new Microphone object''<br/><!--GIDEROSMTD:Microphone.new(deviceName,sampleRate,numChannels,bitsPerSample,quality) creates a new Microphone object--> | [[Microphone.new]] ''creates a new Microphone object''<br/><!--GIDEROSMTD:Microphone.new(deviceName,sampleRate,numChannels,bitsPerSample,quality) creates a new Microphone object--> | ||
[[Microphone:getDeviceList]] ''lists available mics''<br/><!--GIDEROSMTD:Microphone:getDeviceList() lists available mics--> | |||
[[Microphone:getStreamId]] ''gets the mic stream id''<br/><!--GIDEROSMTD:Microphone:getStreamId() gets the mic stream id--> | [[Microphone:getStreamId]] ''gets the mic stream id''<br/><!--GIDEROSMTD:Microphone:getStreamId() gets the mic stream id--> | ||
[[Microphone:isPaused]] ''returns the mic paused status''<br/><!--GIDEROSMTD:Microphone:isPaused() returns the mic paused status--> | [[Microphone:isPaused]] ''returns the mic paused status''<br/><!--GIDEROSMTD:Microphone:isPaused() returns the mic paused status--> | ||
Revision as of 20:51, 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 |