p5.js-sound icon indicating copy to clipboard operation
p5.js-sound copied to clipboard

p5.sound with Microphone seems broken

Open itspacchu opened this issue 3 years ago • 9 comments

I was trying to create Audio spectrum from this Example and i've given the permission for microphone... the output is blank. I think AudioIn() is broken.

amp = mic.getLevel(); console.log(amp);

doesn't seem to work either

This was the error popping up on console. image

Not working on Chrome , Edge and Firefox.

itspacchu avatar Aug 06 '20 16:08 itspacchu

Hey There,

this appears to be the same issue as the following (I'm only assuming):

https://github.com/processing/p5.js-sound/issues/506 https://github.com/processing/p5.js-sound/issues/507

Add this to the list of methods that aren't working for P5.sound. This issue seems to have appeared only a few days ago.

BrewHog avatar Aug 06 '20 19:08 BrewHog

@itspacchu have you tried on p5web-editor? Please share the link if so, it is more easy to see that way! Thanks

endurance21 avatar Aug 17 '20 21:08 endurance21

Check this out https://editor.p5js.org/itspacchu/sketches/I-1gFQbse taken from this example

itspacchu avatar Aug 21 '20 07:08 itspacchu

The mic.getLevel() function seems to be the problem, if we pass the mic = p5.AudioIn() to fft=p5.FFT() as input fft.setInput(mic) we get the bins without any problem.

lorforlinux avatar Dec 03 '20 20:12 lorforlinux

any update on this? I'm experiencing this as well

matt-scientist avatar Mar 09 '21 03:03 matt-scientist

This is still broken on FireFox as of v89, and on Safari v14, but it is working in Chromium based browsers as of v91. Here's the sketch I'm using to test: https://openprocessing.org/sketch/1226979 (note: the area under the spectrum curve becomes solid green as the value returned by getLevel approaches 1.0, you have to be pretty loud to get an appreciable value, I suggest thumping the mic).

sflanker avatar Jul 01 '21 00:07 sflanker

Somebody should rename this issue to "AudioIn.getLevel not working in Firefox or Safari" or something like that.

sflanker avatar Jul 01 '21 00:07 sflanker

@itspacchu why was this closed? It is still broken in non-Chromium browsers. Here's a better example that actually uses the latest release https://openprocessing.org/sketch/1230823/pc/SfNsbbCi

If there is a commit/merge that fixes this since the last release could you please link it?

sflanker avatar Jul 09 '21 23:07 sflanker

@itspacchu why was this closed? It is still broken in non-Chromium browsers. Here's a better example that actually uses the latest release https://openprocessing.org/sketch/1230823/pc/SfNsbbCi

If there is a commit/merge that fixes this since the last release could you please link it?

I kinda got it working so throught it was fixed

itspacchu avatar Jul 10 '21 02:07 itspacchu