files/en-us/web/api/speechrecognitionevent/index.md
{{APIRef("Web Speech API")}}
The SpeechRecognitionEvent interface of the Web Speech API represents the event object for the {{domxref("SpeechRecognition.result_event", "result")}} and {{domxref("SpeechRecognition.nomatch_event", "nomatch")}} events, and contains all the data associated with an interim or final speech recognition result.
{{InheritanceDiagram}}
SpeechRecognitionEvent object.SpeechRecognitionEvent also inherits properties from its parent interface, {{domxref("Event")}}.
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}}