redpandabear
YaBB Newbies
Offline
Posts: 5
speeding up process(sound and video)
Mar 30th , 2008, 4:29pm
hello there, this is my first message on this board, so please forgive any errors i make etc. I am creating a project that captures sound and uses this to alter the image of a live input (web cam)using the video library and sonia Here is the code- ----------------------------------------------------------- import pitaru.sonia_v2_9.*; import processing.video.*; Capture cam; void setup(){ size(640,480); background(0); cam = new Capture(this, 640, 480); loadPixels(); frameRate(10); Sonia.start(this); LiveInput.start(32); } void draw(){ background(0); LiveInput.getSpectrum(); for(int a=1;a<32;a+=1){ circleStrip(a*20, LiveInput.spectrum[a]); } } void circleStrip(int stripLoc, float spectrumData){ for (int i = -20; i < height ; i+=20){ int j = stripLoc; noStroke(); int intspectrumdata = int(spectrumData); noStroke(); cam.read(); color d = cam.get(j, i); fill(d, 50); rectMode(CENTER); rect (j, i , 30 + intspectrumdata, 30 + intspectrumdata); } } ----------------------------------------------------------- My major problem is that it i am only receiving an image every 7 seconds, and i would preferably have two every second, in order to speed it up i can use less channels (16 instead of 32), or use a faster computer, but i was wandering if anybody knew of a way to speed it up in other ways such as code structure, retaining the image quality, any help would be greatly appreciated , many thanks (i posted this message in the sound folder and the video folder, sorry if thats frowned upon, i wasn't sure which one to put the message in and am quite needy for the help, sorry again)