Loading audio from mic

I’m trying to configure processing to accept microphone input for audio processing, however I keep getting the same error no matter what example sketch I try.

error;

Audio Input not configured in start() method.

sketch 1

import processing.sound.*;
FFT fft;
AudioIn in;
int bands = 512;
float[] spectrum = new float[bands];

void setup() {
  size(512, 360);
  background(255);
    
  // Create an Input stream which is routed into the Amplitude analyzer
  fft = new FFT(this, bands);
  in = new AudioIn(this, 0);
  
  // start the Audio Input
  in.start();
  
  // patch the AudioIn
  fft.input(in);
}      

void draw() { 
  background(255);
  fft.analyze(spectrum);

  for(int i = 0; i < bands; i++){
  // The result of the FFT is normalized
  // draw the line for frequency band i scaling it up by 5 to get more amplitude.
  line( i, height, i, height - spectrum[i]*height*5 );
  } 
}

sketch 2,

import processing.sound.*;
FFT fft;
AudioIn in;
int bands = 512;
float[] spectrum = new float[bands];

void setup() {
  size(512, 360);
  background(255);

  // Create an Input stream which is routed into the Amplitude analyzer
  fft = new FFT(this);
  in = new AudioIn(this, 0);

  // start the Audio Input
  in.start();

  // patch the AudioIn
  fft.input(in, bands);
}      

void draw() { 
  background(255);
  fft.analyze(spectrum);

  for(int i = 0; i < bands; i++){
  // The result of the FFT is normalized
  // draw the line for frequency band i scaling it up by 5 to get more amplitude.
  line( i, height, i, height - spectrum[i]*height*5 );
  } 
}

sketch3

import processing.sound.*;
AudioIn in;

void setup() {
  size(640, 360);
  background(255);
    
  // Create the Input stream
  in = new AudioIn(this, 0);
  in.play();
}      

void draw() {
}

I have also tried the included minim library and it also produces and error

// Example 20-5: Live Input with Sonia

import processing.sound.*;

AudioIn input;
Amplitude analyzer;

Ball b[];
int k = 100;

void setup() {
  size(700, 700);
  
  // Start listening to the microphone
  // Create an Audio input and grab the 1st channel
  input = new AudioIn(this, 0);

  // start the Audio Input
  input.start();

  // create a new Amplitude analyzer
  analyzer = new Amplitude(this);

  // Patch the input to an volume analyzer
  analyzer.input(input);
  
  // create ball
  b = new Ball[55];
  for(int i=0;i<b.length;i++)
  {
    b[i] = new Ball(random(50,width),random(50,height),random(4,7),random(2,4));
  }

}

void draw() {
  background(0);
  
  fill(0);
  stroke(255);
  
  plexus();
  
}

class Ball
{
    
  // Get the overall volume (between 0 and 1.0)
  float vol = analyzer.analyze();
  
  float x,y,dx,dy;
  Ball(float x, float y, float dx, float dy)
  {
    this.x = x;
    this.y = y;
    this.dx = dx;
    this.dy = dy;
    BallMoved();
  }
  void BallMoved()
  {
    x+=dx;
    y+=dy;
    if(x>width || x<0)dx = -dx;
    if(y>height || y<0)dy = -dy;
    ellipse(x,y,3,3);
    }
}

void plexus()
{    
  for(int i=0;i<b.length;i++)
  {
    b[i].BallMoved();
    for(int j=0;j<b.length;j++)
    {
      if(b[i].x-b[j].x<k && b[i].y-b[j].y<k && b[i].x-b[j].x>-k && b[i].y-b[j].y>-k)
      {
        stroke(255);
        line(b[i].x,b[i].y,b[j].x,b[j].y);
      }
    }
  }
}
==== JavaSound Minim Error ====
==== Unable to return a TargetDataLine: unsupported format - PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian

=== Minim Error ===
=== Minim.getLineIn: attempt failed, could not secure an AudioInput.

=== Minim Error ===
=== Couldn't invoke the sketchPath method: null

=== Minim Error ===
=== Couldn't create an AudioRecorder for myrecording.wav.

realtek driver issue…