Answer the question
In order to leave comments, you need to log in
Drives speech synthesis from Translate.google.com, what should I do?
There is code:
<?php
$words = substr($_GET['words'], 0, 100);
$file = md5($words);
$file = "audio/" . $file. ".mp3";
if (!file_exists($file)) {
$mp3 = file_get_contents(
' translate.google.com/translate_tts?q= '.$words.'&tl=ru');
file_put_contents($file, $mp3);
}
?>
In theory, it was supposed to reproduce words through translate.google.com , but when I run this code, the output I get is not at all what I wanted.
For example, you need to reproduce the word "hello".
Here's what I got as a result! Link
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question