Skip to content

perf: keep 1 s of raw audio in openWakeWord's preprocessor - #34

Open
Ale Paredes (ale7714) wants to merge 1 commit into
mainfrom
perf/oww-raw-audio-deque
Open

Ale Paredes (ale7714) wants to merge 1 commit into
mainfrom
perf/oww-raw-audio-deque

Conversation

@ale7714

Copy link
Copy Markdown
Contributor

Alternative to #32. openwakeword 0.6.0 copies its whole 10 s raw-audio deque into a list on every 80 ms chunk, then reads only the newest 1,760 samples. #32 removes the copy by swapping in a numpy buffer and its own versions of two private openwakeword methods. This sets the deque to 1 s, which holds the same samples, so no openwakeword code is replaced and it keeps about 80% of #32's saving.

With the real melspectrogram, embedding, hey_jarvis_v0.1 and alexa_v0.1 models on 55 s of speech and noise, scores and buffers matched stock exactly, with speex noise suppression on, for 80 ms and mixed chunk sizes. Chunks up to 960 ms stay exact; the module always sends 80 ms.

Median predict() per chunk on Linux aarch64, speex on, one core, across three runs (Docker on Apple silicon, not a Pi):

median
stock 2.05 to 2.20 ms
#32 1.48 to 1.51 ms
this 1.59 to 1.66 ms

The version test fails when setup.sh installs anything but openwakeword 0.6.0, so a bump has to recheck what AudioFeatures reads.

🤖 Generated with Claude Code

openwakeword 0.6.0 copies its whole 10 s raw-audio deque into a list on every
80 ms chunk but reads only the newest chunk plus 480 samples. A 1 s deque holds
the same samples for any chunk up to 960 ms, so features and scores don't
change. A test on the installed openwakeword version makes a bump recheck that.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@viam-overwatch

Copy link
Copy Markdown
Contributor

Hey Ale Paredes (@ale7714) — CI is green and no reviewer is assigned yet. Could you request one when you have a chance?

Auto-comment from overwatch. Will not re-nudge for 7 days.

2 similar comments
@viam-overwatch

Copy link
Copy Markdown
Contributor

Hey Ale Paredes (@ale7714) — CI is green and no reviewer is assigned yet. Could you request one when you have a chance?

Auto-comment from overwatch. Will not re-nudge for 7 days.

@viam-overwatch

viam-overwatch Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Hey Ale Paredes (@ale7714) — CI is green and no reviewer is assigned yet. Could you request one when you have a chance?

Auto-comment from overwatch. Will not re-nudge for 7 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant