AudioInput response only zeros

edited August 2014 in Library Questions

Hi, I want to do some automatic drawing dependent on the frequency of sound. This works perfect when I use the AudioPlayer class. Now I want to get audio input from anything that is running on my computer (could be from VLC-Player or Microfone-in). That for I found some simple examples using AudioInput or LiveInput. But if I run that examples .left.get(i) and .right.get(i) response only zeros. Am I missing something obvious? I am using Processing2.2.1 on Windows 7, 64 Bit on an AMD FX(tm)-6200 Processor I have an audio interface (Firebox PreSonus), but I also tryed it with the internal soundcard and it didn´t work.

I found something promising for Ubuntu systems: rwalter.de/process-any-sound-that-is-played-through-your-sound-card-in-java-processing/ Any suggestions how to make it run on Windows would be nice! Thanks in advance!

This is an example:

import ddf.minim.*;

Minim minim;
AudioInput in;

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

  minim = new Minim(this);

  // use the getLineIn method of the Minim object to get an AudioInput
  in = minim.getLineIn();
}

void draw()
{
  background(0);
  stroke(255);
  in.enableMonitoring();
  // draw the waveforms so we can see what we are monitoring
  for(int i = 0; i < in.bufferSize() - 1; i++)
  {
    line( i, 50 + in.left.get(i)*50, i+1, 50 + in.left.get(i+1)*50 );
    line( i, 150 + in.right.get(i)*50, i+1, 150 + in.right.get(i+1)*50 );
    println(100*in.right.get(i));
    println(100*in.left.get(i));
  }  
}
Tagged:

Answers

Sign In or Register to comment.