mirror of https://github.com/coqui-ai/TTS.git
fix(espeak_wrapper): capture stderr separately
Fixes https://github.com/coqui-ai/TTS/issues/2728 Previously, error messages from espeak were treated as normal output and also converted to phonemes. This captures and logs them separately.
This commit is contained in:
parent
06304504d2
commit
7b2289a454
|
@ -60,9 +60,12 @@ def _espeak_exe(espeak_lib: str, args: List, sync=False) -> List[str]:
|
||||||
with subprocess.Popen(
|
with subprocess.Popen(
|
||||||
cmd,
|
cmd,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.STDOUT,
|
stderr=subprocess.PIPE,
|
||||||
) as p:
|
) as p:
|
||||||
res = iter(p.stdout.readline, b"")
|
res = iter(p.stdout.readline, b"")
|
||||||
|
err = iter(p.stderr.readline, b"")
|
||||||
|
for line in err:
|
||||||
|
logger.warning("espeakng: %s", line.decode("utf-8").strip())
|
||||||
if not sync:
|
if not sync:
|
||||||
p.stdout.close()
|
p.stdout.close()
|
||||||
if p.stderr:
|
if p.stderr:
|
||||||
|
|
Loading…
Reference in New Issue