Bug 1556 : Minim Java Error
Last modified: 2010-05-02 06:08




Status:
RESOLVED
Resolution:
WONTFIX -
Priority:
P2
Severity:
normal

 

Reporter:
jonobrone
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2010-05-01 22:53
1. Processing 1.1 (0182)
2. Mac OSX 10.6.3
3. The getLineIn Minim Example
4.

/**
* Get Line In
* by Damien Di Fede.
*
* This sketch demonstrates how to use the <code>getLineIn</code> method of
* <code>Minim</code>. This method returns an <code>AudioInput</code> object.
* An <code>AudioInput</code> represents a connection to the computer's current
* record source (usually the line-in) and is used to monitor audio coming
* from an external source. There are five versions of <code>getLineIn</code>:
* <pre>
* getLineIn()
* getLineIn(int type)
* getLineIn(int type, int bufferSize)
* getLineIn(int type, int bufferSize, float sampleRate)
* getLineIn(int type, int bufferSize, float sampleRate, int bitDepth)
* </pre>
* The value you can use for <code>type</code> is either <code>Minim.MONO</code>
* or <code>Minim.STEREO</code>. <code>bufferSize</code> specifies how large
* you want the sample buffer to be, <code>sampleRate</code> specifies the
* sample rate you want to monitor at, and <code>bitDepth</code> specifies what
* bit depth you want to monitor at. <code>type</code> defaults to
<code>Minim.STEREO</code>,
* <code>bufferSize</code> defaults to 1024, <code>sampleRate</code> defaults to
* 44100, and <code>bitDepth</code> defaults to 16. If an <code>AudioInput</code>
* cannot be created with the properties you request, <code>Minim</code> will report
* an error and return <code>null</code>.
*
* When you run your sketch as an applet you will need to sign it in order to get an input.
*
* Before you exit your sketch make sure you call the <code>close</code> method
* of any <code>AudioInput</code>'s you have received from <code>getLineIn</code>.
*/

import ddf.minim.*;

Minim minim;
AudioInput in;

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

minim = new Minim(this);
minim.debugOn();

// get a line in from Minim, default bit depth is 16
in = minim.getLineIn(Minim.STEREO, 512);
}

void draw()
{
background(0);
stroke(255);

// draw the waveforms
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);
}
}


void stop()
{
// always close Minim audio classes when you are done with them
in.close();
minim.stop();

super.stop();
}

5.

java(1281,0xb528f000) malloc: *** error for object 0x2a2a2a2a: pointer being freed was not
allocated
*** set a breakpoint in malloc_error_break to debug
java(1281,0xb528f000) malloc: *** error for object 0x6d646423: pointer being freed was not
allocated
*** set a breakpoint in malloc_error_break to debug
java(1281,0xb528f000) malloc: *** error for object 0xffffffff: pointer being freed was not
allocated
*** set a breakpoint in malloc_error_break to debug
Additional Comment #1 From fry 2010-05-02 06:08
You'd need to contact damien (who wrote minim) for minim bugs, but this
error is outside of Java (anything that we can control) and looks like a
bug in Apple's Java implementation, or that your Java installation is
somehow broken (for instance, if you installed Java 1.5 on OS X 10.6).