We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Odd Problem
Page Index Toggle Pages: 1
Odd Problem (Read 338 times)
Odd Problem
Mar 9th, 2006, 12:30am
 
I am new to Processing and Im getting a white error when I run my code. This is the code. Can some one tell me what is up. You will need a audio in and out for it to work its running off a sencer and then recording from a mic. You should understand it its not that big. Oh ye and Im using a Mac if that helps.

Cheers

XxX

import pitaru.sonia_v2_9.*;

public Sample mySample;
public Sample mySample2;
public int tStamp;
public int tStamp2;
public int count;

float[] tempBuffer;
float[] tempBuffer2;

int sampleLength = 5;  
int sampleRate = 44100;  
int numFrames = sampleRate*sampleLength;

void setup(){
 
Sonia.start(this);
LiveInput.start();
tStamp=minute();
 
}



void draw(){

float meterData = LiveInput.getLevel(0);
//println(meterData);



if(meterData>0.07812835 && minute()<tStamp+5){
 
 println("Door Bell Ringing");
 startRecording();
 tStamp=minute();

 }  
flippingSound();

}

void startRecording(){
println("recording");
LiveInput.startRec(mySample);
}

void flippingSound(){
 mySample.write(tempBuffer);
   
   for(int i=0; i<tempBuffer.length; i++){
     //flip round the sound
     tempBuffer2[i]=(tempBuffer.length-i);
   }
   mySample2.read(tempBuffer2);
   mySample2.play();
   
 }
Page Index Toggle Pages: 1