Minim on Raspberry Pi

seems that this library doesn't work properly on Linux. Been trying all morning to get it up and running but I get a error message. the sketch runs fine on any other machine....

any ideas of a workaround for this? I'm trying to do very simple beat detection using the linein from a USB audio device.

ERROR MESSAGE:

==== JavaSound Minim Error ==== ==== Error acquiring TargetDataLine: null

Exception in thread "Thread-1" java.lang.IllegalStateException: Line must be open()ed before it can be start()ed at org.classpath.icedtea.pulseaudio.PulseAudioDataLine.start(PulseAudioDataLine.java:345) at org.classpath.icedtea.pulseaudio.PulseAudioTargetDataLine.start(PulseAudioTargetDataLine.java:402) at ddf.minim.javasound.JSAudioStream.run(JSAudioStream.java:62) Exception in thread "Thread-1" java.lang.IllegalStateException: Line must be open()ed before it can be start()ed at org.classpath.icedtea.pulseaudio.PulseAudioDataLine.start(PulseAudioDataLine.java:345) Exception in thread "Thread-1" java.lang.IllegalStateException: Line must be open()ed before it can be start()ed at org.classpath.icedtea.pulseaudio.PulseAudioDataLine.start(PulseAudioDataLine.java:345) at org.classpath.icedtea.pulseaudio.PulseAudioTargetDataLine.start(PulseAudioTargetDataLine.java:402) at ddf.minim.javasound.JSAudioStream.run(JSAudioStream.java:62) at org.classpath.icedtea.pulseaudio.PulseAudioTargetDataLine.start(PulseAudioTargetDataLine.java:402) at ddf.minim.javasound.JSAudioStream.run(JSAudioStream.java:62) Exception in thread "Thread-1" java.lang.IllegalStateException: Line must be open()ed before it can be start()ed at org.classpath.icedtea.pulseaudio.PulseAudioDataLine.start(PulseAudioDataLine.java:345) at org.classpath.icedtea.pulseaudio.PulseAudioTargetDataLine.start(PulseAudioTargetDataLine.java:402) at ddf.minim.javasound.JSAudioStream.run(JSAudioStream.java:62)

CODE:

import ddf.minim.*;
import ddf.minim.analysis.*;
//import javax.sound.samlped.*;
Minim minim;
AudioInput in;
BeatDetect beat;
FFT fft;
float a;

void setup()
{
    size(200, 200, P3D);

 //   open(AudioInputStream stream);

     minim = new Minim(this);
   //  AudioSystem.getMixerInfo();
  in = minim.getLineIn(Minim.STEREO, 512);

  beat = new BeatDetect();
  beat.setSensitivity(300);
}

void draw() 
{
  background(0);
  beat.detect(in.mix);
  if(beat.isOnset()) a = 255; 
  fill(200,0,0,a);
  rect(20,20,50,50);

  //println(AudioSystem.getMixerInfo);
  a *=0.98;
  if (a < 0.1) a= 0.1;
}
Sign In or Register to comment.