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 & HelpSound,  Music Libraries › problems with Sonia's connectLiveInput()
Page Index Toggle Pages: 1
problems with Sonia's connectLiveInput() (Read 1109 times)
problems with Sonia's connectLiveInput()
May 1st, 2005, 4:50pm
 
hi,

i want to use connectLiveInput() to enables real-time FFT ananlysis of my Sample Object. then want to get the spectrum with sample.getSpectrum()  
everythings seems fine, but when i'm running my code a nullpointerexception (at Sample.connectLiveInput) occurs.

my code:

Sample sound;

void setup(){
  this.size(400,400);    
  Sonia.start(this); // Start Sonia engine.  
  this.sound = new Sample("test.wav");
  this.sound.connectLiveInput(true);
  this.sound.repeat();    
}

void loop(){
  background(55,55,55);  
  FFT();
}

private void FFT(){
  sound.getSpectrum(2);
  float volume = sound.getVolume();  
}

the test.wav is located in the data folder.
where is the problem?
thx for help
h4nni
Re: problems with Sonia's connectLiveInput()
Reply #1 - Dec 6th, 2005, 1:48pm
 
I hope you have solved it. Is just that i got the same problem and got the solution. The problem was trying to connect to the Live Input without starting the LiveInput object.

This is my try:

Code:

void setup() {
size(640, 480);
Sonia.start(this);
LiveInput.start();
mySample = new Sample("test.wav");

try {
mySample.connectLiveInput(true);
}
catch(Exception e) {
println(e.toString());
}

mySample.play();
}
Page Index Toggle Pages: 1