From a758272e140ed76ae0a13cb53b271b4c4eb732fb Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 12 Jul 2017 14:01:01 -0400 Subject: [PATCH] updated some files --- LoveKaraoke/main.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/LoveKaraoke/main.lua b/LoveKaraoke/main.lua index 858af5c..4311e1a 100644 --- a/LoveKaraoke/main.lua +++ b/LoveKaraoke/main.lua @@ -30,6 +30,8 @@ function love.load() source = microphone.newQueueableSource() device:setDataCallback(function(device, data) if recording then + source:queue(data) + source:play() table.insert(record,{data,os.clock()}) test:setDualDim(nil,nil,nil,nil,nil,nil,peakAmplitude(data)) test2:setDualDim(nil,nil,nil,nil,nil,nil,rmsAmplitude(data)) @@ -46,12 +48,14 @@ test0:OnReleased(function(b,self) if self.text=="Start Recording" then self.text="Stop Recording" recording=true - else + elseif self.text=="Stop Recording" then test0.text="Playing Back!" recording=false local step=multi:newStep(1,#record) step:OnStep(function(self,pos) source:queue(record[pos][1]) + test:setDualDim(nil,nil,nil,nil,nil,nil,peakAmplitude(record[pos][1])) + test2:setDualDim(nil,nil,nil,nil,nil,nil,rmsAmplitude(record[pos][1])) if pos>1 then self:hold(record[pos][2]-record[pos-1][2]) end