Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
Microphone sound length not determined - Gideros Forum

Microphone sound length not determined

YanYan Member
edited April 12 in Plugins
Is it possible to strongly determine microphone sound length, or cut sound to fixed sound length ?

This code shows: Microphone sound always less on about 200-300ms (variable results each time), than it should be.

I understand theres some idle before hardware started and ended, but this is very important for my new project, and I dont know how to solve this ? Any help ?
application:setKeepAwake(true)
 
require 'microphone'
 
local file = '|D|file.wav'
 
local mic = Microphone.new(nil, 44100, 2, 16, 1)
mic:setOutputFile(file)
 
local timer = Timer.new(1000, 1)
timer:addEventListener(Event.TIMER_COMPLETE, function()
 
	mic:stop()
 
	local sound = Sound.new(file)
 
	print(sound:getLength())	-- 700\800 ms instead of 1000
 
end)
 
timer:start()
mic:start()

Likes: oleg

vk.com/yan_alex
+1 -1 (+1 / -0 ) Share on Facebook

Comments

Sign In or Register to comment.