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. 如何將語音轉換爲iPhone中的文本?
- 8. 如何將語音轉換爲java中的文本?
- 9. 如何將音頻轉換爲文本?
- 10. Linux中的語音轉換爲文本
- 11. 如何將文本轉換爲語音而不使用Openears庫?
- 12. 如何將標籤文本轉換爲語音
- 13. 如何將文本字符串轉換爲語音
- 14. 如何在配音演講時將文本轉換爲語音,反之亦然?
- 15. 如何將音頻文件.wav或語音識別轉換爲文本,Android Studio
- 16. 用於將語音/音頻數據轉換爲文本的API
- 17. 語音轉換爲文本javascript,html5
- 18. 語音到MS轉換文本轉換
- 19. 在PHP中將文本轉換爲PDF
- 20. 在PHP中將文本轉換爲HTML
- 21. 如何將亞馬遜Kindle文本轉換爲語音跳過一些文本
- 22. 將語音轉換爲iphone中的文本
- 23. 將語音轉換爲iPhone中的文本
- 24. 如何將文本中的語音更改爲語音識別?
- 25. 如何將阿拉伯文字轉換爲SAMPA語音文字?
- 26. Emacs中的文本到語音轉換
- 27. 如何在Visual C#/ C++中實現文本 - 語音轉換(TTS)?
- 28. 如何在ubuntu 10.10上使用python將文本轉換爲語音?
- 29. 如何將文本轉換爲Swift操作系統中的OSX語音
- 30. 將音頻轉換爲文本
您可能需要運行某種軟件PHP調用的服務器。我認爲用純PHP做這件事並不可行。 – Sam152 2011-01-21 04:56:17