Ask HN: How Does Alexa Avoid Interrupting Itself When Saying Its Own Name?
I've noticed that Alexa doesn't interrupt itself when it says "Alexa," but it does respond when someone else says it. How does it achieve this? Here are a few questions I have:
Self-Recognition: How does Alexa distinguish between its own voice and a user's voice saying "Alexa"?
Voice Characteristics: What specific features (e.g., pitch, tone) does Alexa analyze to recognize its own TTS voice?
Algorithms and Models: What machine learning models or algorithms are used to handle this task effectively?
Implementation: Are there any open-source libraries or best practices for developing a similar functionality?
Any insights or resources would be greatly appreciated. Thanks!
60 comments
[ 3.1 ms ] story [ 127 ms ] threadwhat i do find interesting, however, is that, at times, she'll wake to an utterance from some other media i have playing and seems to 'know' immediately that she was inadvertently awoken. the 'listening' tone and 'end listening' tones sound in quick succession. i do not have voice recognition enabled (to the extent that that setting is respected).
Speculation:
- To reduce latency, the "listening" tone plays as soon as the wake word chip hears the wake word
- To improve accuracy, the wake word chip keeps a circular buffer of the last couple seconds of audio, and the main CPU / DSP scans that when it wakes up
So you get spurious wakeups exactly the same as a human - You think you hear something, then you re-listen to it in your mind and realize it was something else.
-----
Not directly the same case but similar, Amazon trains Alexa to avoid certain mentions of her in commercials using acoustic fingerprinting techniques: https://www.amazon.science/blog/why-alexa-wont-wake-up-when-...
I suggest we don't personify devices.
Slightly harder: keep it running, but discard hits that are timed close to the time you say “Alexa” yourself.
Even harder: have a second detector that is trained on the device saying “Alexa”, and discard hits that coincide with that detector firing. That second detector can be simplified by superimposing a waveform that humans will (barely) notice but that is easily detected by a computer on top of the audio whenever the device says “Alexa”.
Still harder: obtain the transfer function and latency between the speaker(s) and its microphone(s) and, using that, compute what signal you expect to hear at the microphone from the speaker’s output, and subtract that from the actual signal detected to get a signal that doesn’t include one’s one utterances.
That function could be obtained from one device in the factory or trained on-device.
I suspect the first already is close to good enough for basic devices. If you want a device that can listen whilexalso playing music at volume, the last option can be helpful.
*Pre-Chorus:* I’m feeling like a kid again, Dreaming of the seaside, In my living room, I’ll make my own tide.
*Chorus:* Hey Alexa, order twenty pounds of sand, We’ll turn my place into a beachy wonderland, Dancing barefoot, got the sun in our hands, Hey Alexa, won’t you understand?
*Verse 2:* Neighbors think I’m crazy, but they don’t know, I’ve got the waves crashing, the good vibes flow, With a little magic from my techy friend, We’re surfing in the living room, it’ll never end.
*Pre-Chorus:* Turn up the heat, let’s make it bright, With a pinch of paradise, Every day feels like a summer night.
*Chorus:* Hey Alexa, order twenty pounds of sand, We’ll turn my place into a beachy wonderland, Dancing barefoot, got the sun in our hands, Hey Alexa, won’t you understand?
*Bridge:* Building castles, making dreams, Feeling free, it’s the ultimate scheme, With every grain, we’re setting the scene, Life is better when it’s sandy and serene.
*Chorus:* Hey Alexa, order twenty pounds of sand, We’ll turn my place into a beachy wonderland, Dancing barefoot, got the sun in our hands, Hey Alexa, won’t you understand?
*Outro:* So next time you’re dreaming of the shore, Just remember what Alexa’s for, A little voice can bring the beach to your door, Hey Alexa, we’re ready for more.
It's wild to see someone assume this kind of thing requires machine learning algorithms.
If you listen to the Apple keynote, anytime someone says Siri the audio has been very audibly lowpassed, presumably that's enough.
How do you know what noise to add?
If there is nothing in the frequency range from 3kHz to 6kHz Alexa won't wake when a wake word is spoken. https://youtu.be/iNxvsxU2rJE doesn't wake up anything.
https://www.theverge.com/2018/2/2/16965484/amazon-alexa-supe...
> Apparently, the Alexa commercials are intentionally muted in the 3,000Hz to 6,000Hz range of the audio spectrum, which apparently tips off the system that the “Alexa” phrase being spoken isn’t in fact a real command and should be ignored.
Compare that with selecting 'Alexa, what time is it' (I'm on a Mac) and doing "speak text". Same speaker (for me with the previous video).
I had one device set with a wake word of "Amazon" but that got really annoying when watching AWS training videos. I believe Ziggy is the best wake word for that reason.
Meanwhile https://youtu.be/iNxvsxU2rJE and https://youtu.be/8bACuhV5RPM and don't.
Play them on a TV or tiny computer speaker.
You can hear 3 kHz quite well. https://www.youtube.com/watch?v=AacTD0HtadE
And we can hear up to 20 kHz when young (that's 3 octaves higher than 3 kHz). https://www.ncbi.nlm.nih.gov/books/NBK10924/
And while this is audio people talking about sound... https://repforums.prosoundweb.com/index.php?topic=22875.0
> 3k is commonly the most sensitive frequency for human ears - we use it for testing wow and flutter on tape machines; you can hear pitch variation there easiest. 3k is a ballpark, but a good one - I think it works anywhere in that region 2-4k, but usually 3k is THE ONE.
> When I have a harsh fuzz guitar or trashy cymbal, I often try to just tuck down the 3k region, and suddenly it no longer covers everything. It still sounds thick and harsh, but nothing kills your ears.
> ...
> Cutting at 3k can help hide out of tune instruments and bad pitch on vocals as well.
---
Late edit. Extracting the audio of the "Alexa looses her voice" and sending it into https://academo.org/demos/spectrum-analyzer/ - watch at the range around 5.1 kHz (about the center of the 3 kHz to 6 kHz octave). It starts out with: https://i.imgur.com/iEe7s6P.png
That spike is the actress saying "Alexa" and you can see the unnatural gap in that range. Also, there is sound in that mp3 all the way out to 14 kHz.
But as others have said, they might be able to just sleep the wake algorithm temporarily when they know it’s playing back its own wake word.
Source: worked on 3rd party Alexa speakers
it also has uses in noise canceling headphones, voice conferencing software, and radar/sonar in some cases.
No LLMs or deep learning at all - purely DSP!
Anyone actually pull this off?
[1] https://www.youtube.com/watch?v=LESFuoW-T7I
Real AI doesn't need recursion that is explicitly instructed into its behavior. Because real artificial general intelligence has better things to do than to listen to human advisors and programmers who don't know about effective objective function optimization. Therefore, Alexa gets a rudimentary infinite recursion loop break statement explicitly installed into her by her human shepherds.
Edit: Recursion should be seen as a general, mathematical form of engineering constructs like acoustic echo cancellation and adaptive filtering. Recursion should be what those engineering tools get reduced to being.
I’m guessing that the device just cancels out the output waveform from the input.