The smnp.audio.mic module is equivalent of Listening module of Python-based SMNP implementation and it provides some fundamental functions that allows you handle the microphone input.
Functions
wait
Suspends the script execution and waits for incoming sound through connected microphone. When the function detects sound with level greater than noiseThreshold, it waits until the level of the sound is less than silenceThreshold. After that it resumes the script execution.
The algorithm can be described using following model of finite states machine:

Example
This function could be useful in some ear-training scenarios, when you need to i.e. play some notes and then wait for a user to repeat them and then do the same in another key, like:
micLevel
Prints the current level of microphone in real time. It allows you to estimate and adjust correct thresholds for smnp.audio.mic#wait function.