* Forcing SoX to process remaining input/flush buffered output without EOF
@ 2019-06-14 10:44 meta .
0 siblings, 0 replies; only message in thread
From: meta . @ 2019-06-14 10:44 UTC (permalink / raw)
[-- Attachment #1.1: Type: text/plain, Size: 1043 bytes --]
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
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.
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.
[-- Attachment #1.2: Type: text/html, Size: 1209 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
[-- Attachment #3: Type: text/plain, Size: 158 bytes --]
Sox-users mailing list
^ permalink raw reply [flat|nested] only message in thread
only message in thread, back to index
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-14 10:44 Forcing SoX to process remaining input/flush buffered output without EOF meta .
email@example.com unofficial mirror
Archives are clonable: git clone --mirror https://public-inbox.org/sox-users
Example config snippet for mirrors
Newsgroups are available over NNTP:
note: .onion URLs require Tor: https://www.torproject.org/
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git