OSDN Git Service
(root)
/
nvdajp
/
nvdajpmiscdep.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ab36d89
)
skip pyaudio if not available
author
Takuya Nishimoto
<nishimotz@gmail.com>
Mon, 6 Oct 2014 04:55:03 +0000
(13:55 +0900)
committer
Takuya Nishimoto
<nishimotz@gmail.com>
Mon, 6 Oct 2014 04:55:03 +0000
(13:55 +0900)
jptools/jtalkRunner.py
patch
|
blob
|
history
diff --git
a/jptools/jtalkRunner.py
b/jptools/jtalkRunner.py
index
14463c4
..
c79b583
100644
(file)
--- a/
jptools/jtalkRunner.py
+++ b/
jptools/jtalkRunner.py
@@
-13,7
+13,10
@@
import os
import sys
import wave
import time
-import pyaudio
+try:
+ import pyaudio
+except:
+ pyaudio = None
import cProfile
import pstats
JT_DIR = os.path.normpath(
@@
-61,6
+64,8
@@
voices = [
]
def pa_play(data, samp_rate = 16000):
+ if pyaudio is None:
+ return
p = pyaudio.PyAudio()
stream = p.open(format = p.get_format_from_width(2),
channels = 1, rate = samp_rate, output = True)