Play more than one Audio sample in Processing


While trying to play more than one audio sample in processing you may get a error like this…

==== JavaSound Minim Error ====
==== Couldn't open the line: line with format PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not supported.

==== JavaSound Minim Error ====
==== Unable to return a SourceDataLine: unsupported format - PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian

Screenshot from 2013-05-10 12:52:19

To fix this error

sudo cp /usr/lib/jvm/java-6-openjdk/jre/lib/i386/ ~/Desktop/processing-1.5.1/java/lib/i386/
sudo cp /usr/lib/jvm/java-6-openjdk/jre/lib/ext/pulse-java.jar ~/Desktop/processing-1.5.1/java/lib/ext/
sudo cp /etc/java-6-openjdk/ ~/Desktop/processing-1.5.1/java/lib/

Now try to play usually the problem may get fixed by this..but if the problem persists then its an ownership problem since pulse-java.jar and were owned by root.Then do these steps

sudo chown MYUSR:MYUSR ~/Desktop/processing-1.5.1/java/lib/ext/pulse-java.jar
sudo chown MYUSR:MYUSR ~/Desktop/processing-1.5.1/java/lib/i386/
chmod +x ~/Desktop/processing-1.5.1/java/lib/i386/

replace MYUSR with your current Linux user name.

Substitute ~/Desktop/processing-1.5.1/ with the path were you installed Processing
This will solve the issue happy hacking 🙂

Proocessing to Arduino commnication

The following code describes how processing to arduino serial communication can be done…processing to arduino communication is very helpful when kinect is used along with processing..

Processing code

import processing.serial.*;
Serial port;

void setup() {
size(256, 150);

println("Available serial ports:");

port = new Serial(this, Serial.list()[0], 9600);


void draw() {
// draw a gradient from black to white
for (int i = 0; i < 256; i++) {
line(i, 0, i, 150);

// write the current X-position of the mouse to the serial port as
// a single byte

Serial.list()[0] uses the first port in this list (number 0) and aud used is 9600 if you know the port you can give it directly..

Arduino code

const int ledPin = 12;

void setup()

pinMode(ledPin, OUTPUT);

void loop() {
byte brightness;

if (Serial.available()) {

brightness =;
if(brightness > 100){


First upload the arduino code connect an led to pin no 12 then run the processing code a window will open with black and white gradient..if you move the cursor to white or above 100 then the led becomes high..

Happy Hacking 🙂

Configuring Kinect with processing in ubuntu


To configure kinect with processing in ubuntu 12.04..first download openni installer


uncompress the file…there will be four folders like this.

Screenshot from 2013-01-18 16:55:03

Inside kinect folder there will be one more folder named Sensor-Bin-Linux…all folders will be having an file

open a terminal and cd to each folder and issue the following install command

sudo ./

Now download processing software i used the stable release processing 1.5


extract it

Now download SimpleOpenNI processing library


when you run processing for the first time a folder named sketchbook will be created inside home folder

Copy the ‘’ into this folder:


and extract it

if you don’t have libraries folder then create one inside sketchbook

Now restart porcessing from file menu take Examples>Contributed Libraries>simple openni and select depth image example.

Screenshot from 2013-01-17 03_51_51

Connect the kinect to the system .Now compile and run the code if sucessfulyou will get an output window like this.

Screenshot from 2013-01-17 03_53_50

You need java installed in yur system for the working of processing

Happy Hacking 🙂