Output WAV when stdout is not a TTY

This commit is contained in:
Michael Hansen 2022-03-31 15:46:22 -04:00
commit 62a58d38ff

View file

@ -77,7 +77,7 @@ def main():
if args.output:
args.output.write_bytes(wav_bytes)
_LOGGER.info("Wrote WAV data to %s", args.output)
elif args.stdout:
elif args.stdout or (not sys.stdout.isatty()):
_LOGGER.debug("Writing WAV data to stdout")
sys.stdout.buffer.write(wav_bytes)
else: