A mistake in my code, or a Java-bug?

edited December 2015 in Library Questions

When i close the running of my sketch, processing tells me that it could not run the sketch. Since i'm searching how to use the sound library i have no idea if it is a mistake in my code or a java-bug. Anybody an idea?

Error message:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x000000012905704e, pid=2227, tid=77323
#
# JRE version: Java(TM) SE Runtime Environment (8.0_51-b16) (build 1.8.0_51-b16)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.51-b03 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C  [libmethcla.dylib+0x5604e]  remove_free_block+0x3e
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/Pumba/hs_err_pid2227.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#
Could not run the sketch (Target VM failed to initialize).
For more information, read revisions.txt and Help → Troubleshooting.

Code:

import processing.sound.*;

Amplitude rms;
AudioIn mic;

float scale=5;
float smooth_factor=0.25;
float sum;

int x,y,r;


void settings(){
  fullScreen();
}

void setup(){
  noFill();
  noCursor();
  stroke(255);
  x=width/2;
  y=height/2;
  r=2*height/3;

  mic= new AudioIn(this,0);
  mic.play();

  rms= new Amplitude(this);
  rms.input(mic);
}

void draw(){
  background(0);

  sum+= (rms.analyze() - sum)*smooth_factor;
  float rms_scaled=sum*(height/2)*scale;
   if (rms_scaled<1){
     rms_scaled=1;
   }
  strokeWeight(rms_scaled);
  ellipse(x,y,r,r);
}

Answers

  • Answer ✓

    i would say library problem. processing.sound is causing problems for a lot of people.

Sign In or Register to comment.