Skip to content

Instantly share code, notes, and snippets.

@yohanes yohanes/talk.php
Created Sep 1, 2018

What would you like to do?
header("Content-type: application/json");
$lang = "en";
$dir = "/var/www/html/talkdata/";
$text = $_GET['t'];
$m = urlencode($text);
$filename = $lang . "-". $m . ".mp3";
$file = $dir.$filename;
if (!file_exists($file)) {
$mp3 = file_get_contents(
''. $m .'&tl='. $lang .'&total=1&idx=0&textlen=5&prev=input&client=tw-ob');
file_put_contents($file, $mp3);
echo '{"id":"'.$filename.'"}';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.