Trying to syphon sound from spotify to a sketch

Hey everybody :slight_smile:
I’m testing syphoning sound from my mac to a processing sketch for some audio viz stuff.
I installed Sound Siphon and created a new virtual input.
When i list my sound devices in processing, I can recognize my new virtual input,
and when I run a sketch, sound gets muted as expected( i checked this option in Sound Siphon).
Everything seems to work but whatever I do it seems that sound doesn’t “flow” in.
Here is the small test code i’m running,
I’m also attaching a screenshot of Sound Siphon.

import processing.sound.*;

  Sound s;
  AudioIn   in;  
  Amplitude amp;
  
void setup() {

  size(600, 600);
  colorMode(RGB);
  fill(200,0,0);
  noStroke();
  rectMode(CENTER);

  s   = new Sound(this);
  s.inputDevice(3);

  in  = new AudioIn(this, 0);
  in.start();

  amp = new Amplitude(this);
  amp.input(in);

}

void draw() {
  println(amp.analyze());
  background(0);
  rect(width/2,height/2,30,10+amp.analyze()*100);
}

1 Like