Minim get computer audio?

I wonder if its possible to get what the computer is playing, for example youtube from google chrome.

I have this code that gets the microphone input. I dont know if it works 100% correctly but it kinda works, if someone is able to make this code work correctly, i just entered random numbers, please tell me!

:smiley:

import ddf.minim.analysis.*;
import ddf.minim.*;

Minim minim;
AudioInput input;
FFT fft;

void setup() {
  size(400, 400, P2D);
  minim = new Minim(this);
  input = minim.getLineIn(Minim.STEREO, 1024, 100000);
  fft = new FFT( input.bufferSize(), input.sampleRate());
}

void draw() {
  println(frameRate);
  background(255);
  fft.forward(input.mix);
  
  for (int h = 1; h < 500; h = h +=2) {
    noStroke();
    fill(0);
    rect(50+h/2, 50, 1, fft.getBand(h));
  }
}

Take a look at the examples that come with the Minim Library:

Additional references:
https://code.compartmental.net/minim/

:)

2 Likes

I didnt find anything for output, i think its impossible with minim!

Sometimes you have to fiddle with the Windows sound settings:

https://discourse.processing.org/t/getting-live-audio-input/23143/6

I am not actively working on this… please share if you find a solution.

:)

1 Like

I tried doing this, installing a virtual input device!

This didnt work and i dont knwo why!