我想使用SVOX/pico2wave從Python代碼編寫wav文件。當我從文件寫入就好終端執行該行:Python子程序調用在寫入文件時拋出錯誤
/usr/bin/pico2wave -w=/tmp/tmp_say.wav "Hello world."
我驗證過pico2wave位於/usr/bin
。
這是我的Python代碼:
from subprocess import call
call('/usr/bin/pico2wave -w=/tmp/tmp_say.wav "Hello world."')
...這將引發此錯誤:
Traceback (most recent call last):
File "app/app.py", line 63, in <module>
call('/usr/bin/pico2wave -w=/tmp/tmp_say.wav "Hello world."')
File "/usr/lib/python2.7/subprocess.py", line 168, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory