Text to Speech

Type in some words and make the computer say them. Powered by tts-api.com More stuff at zacharyguard.co.nf

by bizamajig

HTML

<input type=button value="Say something" id=start></input>

CSS

* {
    font-family:Roboto, Helvetica, sans-serif
}
body {
    text-align:right
}
#start {
    position:fixed;
    top:5px;
    left:5px;
    background:rgba(255, 255, 255, .8);
    border:0;
    cursor:pointer;
    padding:10px;
    font-size:15px;
    border-radius:35px;
    box-shadow:0 0 10px rgba(0, 0, 0, .3);
    transition:all .4s;
}
#start:hover {
    border-radius:5px;
    background:rgba(0, 0, 0, .4);
    color:#fff;
    box-shadow:0 0 rgba(0, 0, 0, 0);
    padding-left:30px;
    padding-right:30px
}
#start:focus {
    outline:0
}

JavaScript

$("#start").click(function () {
    var input = prompt("What do you want to say?");
    $("body").append("<audio autoplay><source src=http://tts-api.com/tts.mp3?q=" + escape(input) + " type=audio/mpeg></audio><p>\"" + input + "\"</p>");
    $(document).scrollTop($(document).height());
})