Hey, I am just starting to look into using sound in processing more seriously, and it seems that the best way is with the Processing Foundation Sound library. But I am running into an issue with it. I run my code, and it will not give me any errors or information, it will just run and not do anything. Right now my code is this:
add_library("sound") def setup(): global input global loudness size(1080, 1080) input = AudioIn(this, 0) input.start() loudness = Amplitude(this) loudness.input(input) def draw(): global input global loudness inputLevel = map(mouseY, 0, height, 1.0, 0.0); input.amp(inputLevel) volume = loudness.analyze() sizen = int(map(volume, 0, 0.5, 1, 350)) circle(width/2, height/2, sizen)
But when I run it I get a circle with a size of 1 (presumably), and when I print the volume variable, it just returns a constant 0.0. If I print the sizen variable, it returns a constant 1. I don’t know what I am doing wrong or if I’m even doing anything wrong at all. All I do know is that this is running on Windows 10 and processing 3.5.4. If anyone can help that would be wonderful. If there’s any information that you need I’ll try to get it for you.