开发者

Stupid idea: Mac speech from PHP server?

开发者 https://www.devze.com 2023-04-07 14:42 出处:网络
I want to synthesize Mac OS X speech, but I\'m using a PC. Can I set 开发者_Python百科up a PHP server on my Macbook at home, and have it synthesize text for me, and return it to me through a web reque

I want to synthesize Mac OS X speech, but I'm using a PC. Can I set 开发者_Python百科up a PHP server on my Macbook at home, and have it synthesize text for me, and return it to me through a web request?

Like http://mymacbook.com/speak.php?t=why+hello+there

What secret PHP codes will unlock this possibility? I know I can synthesize speech on the command line with say -o "output.aiff" -f "input.txt" but I need help with the connective tissue here.

And no - I do not want links to Cepstral or AT&T's online speech synthesizer, because I want to use special Mac speech synthesis syntax.


<?php
    file_put_contents('input.txt', $_GET['t']);
    exec('say -o output.aiff -f input.txt');
    header("Content-Type: audio/x-aiff");
    readfile("output.aiff");
    unlink("output.aiff");
    exit;
0

精彩评论

暂无评论...
验证码 换一张
取 消