To view this content, you need to install Java from java.com

This sketch demonstrates how to use the getLineIn method of Minim. This method returns an AudioInput object. An AudioInput 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 getLineIn:

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)  
The value you can use for type is either Minim.MONO or Minim.STEREO. bufferSize specifies how large you want the sample buffer to be, sampleRate specifies the sample rate you want to monitor at, and bitDepth specifies what bit depth you want to monitor at. type defaults to Minim.STEREO, bufferSize defaults to 1024, sampleRate defaults to 44100, and bitDepth defaults to 16. If an AudioInput cannot be created with the properties you request, Minim will report an error and return null.

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 close method of any AudioInput's you have received from getLineIn.

Source code: getLineIn

Built with Processing