p5.js-sound
p5.js-sound copied to clipboard
p5.sound with Microphone seems broken
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.
Not working on Chrome , Edge and Firefox.
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.
@itspacchu have you tried on p5web-editor? Please share the link if so, it is more easy to see that way! Thanks
Check this out https://editor.p5js.org/itspacchu/sketches/I-1gFQbse taken from this example
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.
any update on this? I'm experiencing this as well
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).
Somebody should rename this issue to "AudioIn.getLevel not working in Firefox or Safari" or something like that.
@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?
@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