Voice activity detection (VAD) and wake words: frames, model state and privacy.
Intermediate9 min read
Educational draft content that needs expert review before it is used as an academic reference. Specifications, versions and licences change; check the official source. No experimental result is shown here unless it was actually run.
Learning objectives
Describe a VAD-then-larger-system cascade
Explain why model state is passed between frames
Interpret the effect of the probability threshold
Audio systems at the edge often work as a cascade: a tiny always-on voice activity detector, and when it hears speech it wakes a larger system (wake-word detection or speech recognition). This saves energy and keeps raw audio on the device.
A VAD processes audio in short frames (for example 32 ms) and outputs the probability of speech. The Silero VAD model used here is recurrent and keeps a state between frames, so the state must be passed from one frame to the next and reset when a new stream starts. It runs at 16 kHz.
In the experiment the microphone is processed inside the browser only and no audio is sent. Microphone permission is requested only when you press the button.
Terminology (with Arabic equivalents)
VAD
كشف النشاط الصوتي
Frame
إطار
Sampling rate
معدل أخذ العينات
Wake word
الكلمة المنبّهة
Recurrent state
الحالة التكرارية
Hysteresis
التخلّف (تأخير التبديل)
Worked example
A threshold of 0.5 may cut speech at light breaths; that is why systems use a higher start threshold, a lower end threshold and a short hangover period to avoid chopping.
Code snippet
PythonModel call contract (illustrative)
# Sketch of the Silero v5 call contract (16 kHz)
# frame: 512 new samples, prepend 64 samples of context -> input [1, 576]
# state: float32 [2, 1, 128], zeros at start, replaced by 'stateN'
# sr: int64 scalar 16000 ; output[0] = probability of speech
state = zeros((2, 1, 128))
for frame in frames(audio, 512):
prob, state = model(concat(context, frame), state, 16000)
context = frame[-64:]
An illustrative snippet that was not executed in the lab environment; check library versions in their official documentation before use.
Check yourself
Why is VAD used before a larger recognition system?
To save power and reduce the audio processed
To increase noise
To change the language
To store recordings
Answer and explanation
To save power and reduce the audio processed — A small model runs all the time and wakes the larger one when needed.
What must be passed between Silero VAD frames?
The model state
The file name
The interface key
Nothing
Answer and explanation
The model state — The model is recurrent and needs its state.
When is microphone permission requested in the lab?
Automatically when the page opens
Only when the user clicks the button
At installation
It is not requested
Answer and explanation
Only when the user clicks the button — No capture starts without an explicit user action.
Silero VAD (github.com/snakers4/silero-vad)Not verified
Image and audio processing in the experiments runs inside your browser. Your images and audio are never uploaded and conversations are not stored. Privacy
Assistant Professor of Artificial Intelligence and Deep Learning
University of Al-Qadisiyah
About
Researcher and academic specialising in artificial intelligence (AI), deep learning, computer vision and natural language processing (NLP). The “Deep Learning in Arabic” project aims to enrich Arabic scientific and technical content with sound, free references and software for researchers and learners across the Arab world.
Edge AI Assistant
I am the Edge AI Assistant. Ask about a concept, technology, board or project and I will answer from the lab content with links.
Edge AI Assistant
Local Database Mode
Answers from the lab knowledge base only, without sending your question to any external party. Conversations are not stored.
Smart assistant
Answers from the site’s content
The assistant can make mistakes, so check the attached sources.
Welcome! I am Dr. Alaa Taima, and this is my smart assistant on “Deep Learning in Arabic”. Ask it about any term or topic in artificial intelligence, and it will answer from the site's content with links to the sources.
DL Bot
Your smart assistant · Connecting…
Enter to send · Shift + Enter for a new line · The assistant can make mistakes, so check the sources.