I recently received a PM in which someone requested me to release my Microphone functions. Honestly, I myself almost forgot that I made them. I made them once for a "new library" James was going to make. It never came and I almost forgot about the file.
It's really easy.
Just make sure this function
- Code: Select all
UseMicrophone();
runs every frame.
So put paste it in an Execute Code action and put it in a step event of an object.
After you did that you can use these functions as variables:
GetMicVolume()
BlowingInMic()
ClappedInMic()
GetMicFrequency()
I didn't add support for recording something even though it is possible. It costs way too much memory.
GetMicVolume() returns the volume of the microphone (0 to 127).
BlowingInMic() returns 'true' when someone blows in the microphone else it returns 'false' of course.
ClappedInMic() returns 'true' when someone claps in front of the microphone else it returns 'false'.
GetMicFrequency() returns the frequency of the sound that is recorded by the microphone (in Hz).
Hope this helps.
Jan.
