unofficial mirror
 help / color / Atom feed
From: "meta ." <>
Subject: Forcing SoX to process remaining input/flush buffered output without EOF
Date: Fri, 14 Jun 2019 22:44:20 +1200
Message-ID: <> (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

                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link unofficial mirror

Archives are clonable: git clone --mirror

Example config snippet for mirrors

Newsgroups are available over NNTP:

 note: .onion URLs require Tor:

AGPL code for this site: git clone