voice elements


Web Component wrapper to the Web Speech API, that allows you to do voice recognition (speech to text) and speech synthesis (text to speech) using Polymer.

Really nifty! Thanks to Polymer you’ll be provided with two extra elements you can use: <voice-player> for text to speech and <voice-recognition> for speech to text

<-- text to speech -->
<voice-player autoplay text="Welcome to the jungle! hahaha just kidding!"></voice-player>
<-- speech to text -->
<form id="recognition-form" class="pure-form">
		<textarea id="recognition-input" readonly=""></textarea>
		<button id="recognition-submit" class="pure-button pure-button-primary">Start!</button>

<voice-recognition id="recognition-element"></voice-recognition>

var form = document.querySelector('#recognition-form'),
    input = document.querySelector('#recognition-input'),
    element = document.querySelector('#recognition-element');

form.addEventListener('submit', function(e) {

element.addEventListener('result', function(e) {
    input.textContent = e.detail.result;

<voice-elements> Demo →
<voice-elements> Source (GitHub) →

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.