Microphone and event listeners


(Nirvan) #1

I trying to catch sound level from microphone but I don’t know how to make event listeners work correct.

Can someone help? Thanks.


(JP Mortiboys) #2

Not sure what more help you need; that question on StackOverflow has two answers which address the problem in different ways; the second (muting the microphone output) doesn’t even require attaching an event.

If you could explain exactly what you need help with, I’m sure we can help you out.


(Nirvan) #3

I only need variable which will have number, how loud we speak to microphone. I going to make game where we will do many things by speakig volume.

Ok I solved it, not needed event listeners, only:

		mic = Microphone.getMicrophone();
		mic.setUseEchoSuppression(true);
		mic.setLoopBack(true); //it turn on receiving signal from mic
		mic.soundTransform = new SoundTransform(0); //it mutes signal but not deleting "actvityLevel"