I think this is already built into some voice recognition software in rudimentary ways.
I figured this out when stuck in a looping phone menu and was trying phrases like "other" and "customer service representative" and pushing zero and looping and looping. Finally I said "Go f### yourself you piece of sh##!!!!" and immediately it came back with "Let me get a customer service representative to assist you."
I've tried it quite a few times since and it has worked in maybe 20% of the cases. Conceivably random, but I'm not so sure. Granted, if it is really happening, I'm sure it's keyword matching, not measuring stress in the voice or "emotion" directly. Still... I kind of believe it's a thing.