From bab276b517cc6443150e5d99d5377d5b38ce0965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Przemys=C5=82aw=20Pluta?= Date: Sun, 29 Mar 2020 16:47:05 +0200 Subject: [PATCH] Add wait() finite state machine schema --- schemas/wait_fsm.svg | 3 +++ smnp.audio.mic.md | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 schemas/wait_fsm.svg diff --git a/schemas/wait_fsm.svg b/schemas/wait_fsm.svg new file mode 100644 index 0000000..cbc5b7c --- /dev/null +++ b/schemas/wait_fsm.svg @@ -0,0 +1,3 @@ + + +
WAIT
FOR
SOUND
WAIT...
WAIT
FOR
SILENCE
WAIT...
RESUME
RESUME
The input level exceeds
the noiseThreshold parameter.
The input level exceeds...
The input level falls below
the silenceThreshold parameter.
The input level falls below...
Start
Start
Viewer does not support full SVG 1.1
\ No newline at end of file diff --git a/smnp.audio.mic.md b/smnp.audio.mic.md index 8b3fbb7..4d8b4df 100644 --- a/smnp.audio.mic.md +++ b/smnp.audio.mic.md @@ -9,7 +9,7 @@ wait(noiseThreshold: int, silenceThreshold: int) 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: -[[model/wait_fsm.svg]] +[[schemas/wait_fsm.svg]] ##### 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: