files/en-us/web/api/speechrecognitionresult/index.md
{{APIRef("Web Speech API")}}
The SpeechRecognitionResult interface of the Web Speech API represents a single recognition match, which may contain multiple {{domxref("SpeechRecognitionAlternative")}} objects.
This code is excerpted from our Speech color changer example.
recognition.onresult = (event) => {
const color = event.results[0][0].transcript;
diagnostic.textContent = `Result received: ${color}.`;
bg.style.backgroundColor = color;
};
{{Specifications}}
{{Compat}}