Created
April 27, 2015 08:28
-
-
Save tkon99/a0c55f8c75f548d20190 to your computer and use it in GitHub Desktop.
High quality TTS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require("request"); | |
var open = require('open'); | |
function say(text, callback){ | |
request.post({url:'http://www.acapela-group.com/demo-tts/DemoHTML5Form_V2.php', form: { | |
MyLanguages:"sonid9", | |
MySelectedVoice:"Graham", | |
MyTextForTTS: text, | |
t:"1", | |
SendToVaaS:"" | |
}}, function(err, httpResponse, body){ | |
var patt = /\'(http:\/\/(?:\w|\.|\/|-)+\.mp3)\'/; | |
var res = body.match(patt); | |
var url = res[1]; | |
callback(url); | |
}); | |
} | |
say("Hello sir! What can I do for you?", function(url){ | |
console.log(url); | |
open(url); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment