graphic-processing-site-examples-Libraries-Minim--Sound--GetLineIn-GetLineIn.pde / pde
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>.
(C) Æliens 20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.