Code: Select all
self.audio = love.graphics.newCanvas(self.rate,1,"r32f",0)
Code: Select all
vec4 effect( vec4 color, sampler2D tex, vec2 tc,vec2 sc) {
float t = sc.x;
float y = sin(6000*t)*exp(-2*t);
return vec4(y,0,0,0);
}
in shader we output the r channel for the datasheet. draw thing with the shader to the canvas, so that we get a canvas filled the proper data.
Code: Select all
local data = self.audio:newImageData()
for i ,d in ipairs(self.data) do
print(data:getPixel(i-1,0))
end
thank you fot the help.