2
A
回答
1
也許下面是在上面的鏈接提到的代碼:
<?php
//create a random number filename so that simultaneous users don't overwrite each other
$filename = 'test.txt';
$text = 'This text will be converted to audio recording';
$outputfile = basename($filename, ".txt");
$outputfile = $outputfile . '.wav';
if (!$handle = fopen($filename, "w"))
{
//we cannot open the file handle!
return false;
}
// Write $text to our opened file.
if (fwrite($handle, $text) === FALSE)
{
//couldn't write the file...Check permissions
return false;
}
fclose($handle);
//initialise and execute the festival C engine
//make sure that your environment is set to find the festival binaries!
$cmd = "text2wave $filename -o $outputfile";
//execute the command
exec($cmd);
unlink($filename);
echo "Recording is successful. \nRecording File: " . $outputfile;
//finally return the uptput file path and filename
return $outputfile;
?>
0
,如果你使用的MacOS,你可以簡單地使用蘋果TTS
shell_exec("say -o test.aiff this is a test");
相關問題
- 1. 如何將語音轉換爲文本?
- 2. 如何在python中將文本轉換爲語音(mp3文件)?
- 3. 語音轉換爲PHP文本
- 4. 如何在ios SDK中將語音轉換爲文本
- 5. 將語音轉換爲文本
- 6. 將語音轉換爲文本
- 7. 如何將文本轉換爲Python中的語音
- 8. 如何將語音轉換爲java中的文本?
- 9. 如何將語音轉換爲iPhone中的文本?
- 10. 如何將音頻轉換爲文本?
- 11. Linux中的語音轉換爲文本
- 12. 將RichTextBox中的文本轉換爲語音聲音
- 13. 如何將標籤文本轉換爲語音
- 14. 如何使用vba將PowerPoint文本轉換爲語音
- 15. 如何將文本轉換爲網頁上的語音?
- 16. 如何將文本轉換爲語音而不使用Openears庫?
- 17. 如何在配音演講時將文本轉換爲語音,反之亦然?
- 18. 如何將音頻文件.wav或語音識別轉換爲文本,Android Studio
- 19. 語音轉換成文本
- 20. 用於將語音/音頻數據轉換爲文本的API
- 21. libgdx語音轉換爲文本
- 22. 語音轉換爲文本javascript,html5
- 23. 語音到MS轉換文本轉換
- 24. 如何將hts語音轉換爲android語音的flite
- 25. 在PHP中將文本轉換爲PDF
- 26. 在PHP中將文本轉換爲HTML
- 27. 如何將亞馬遜Kindle文本轉換爲語音跳過一些文本
- 28. 將短信文本轉換爲android中的語音
- 29. 將語音轉換爲iphone中的文本
- 30. 將語音轉換爲iPhone中的文本
您可能需要運行某種軟件PHP調用的服務器。我認爲用純PHP做這件事並不可行。 – Sam152 2011-01-21 04:56:17