Forcing SoX to process remaining input/flush buffered output without EOF

"meta ." <[email protected]>
Newsgroups gmane.comp.audio.sox
Message-ID <CAGy6UqpFgGt-4o5UGChX2LtRgWE6SYCNYrunc7mgL_gnenzh2A@mail.gmail.com>
I want to use a sox instance that reads from stdin and writes to stdout to
process a continuous and potentially endless stream of audio blocks. The
only problem is that it seems sox doesn't write to stdout until its buffer
is filled. As a result, output blocks smaller than the buffer length are
not accessible. Is there a way to alter this behavior using command line
flags?

I'm aware that sending an eof would result in the remaining output being
flushed, but that's not the behavior I'm looking for. I'd like to keep the
sox instance alive to process blocks as needed.

Here's some example python code demonstrating whats happening. Note the
output displaying the missing bytes in the comments at the end.
https://pastebin.com/Ejt6EW21

To run, this snippet requires the soundfile and pexpect packages to be
installed, which can be done by using the commands 'pip install soundfile'
and 'pip install pexpect' in a terminal.
You'll also need to replace the path in 'file = sf.SoundFile(...)' on line
30 with one of your own, ideally a wav.

_______________________________________________
Sox-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sox-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.