From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS6130 216.105.38.0/24 X-Spam-Status: No, score=-3.1 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,HTML_OBFUSCATE_05_10, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 5FAF21F462 for ; Fri, 14 Jun 2019 10:44:55 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1hbjhR-0001in-HU; Fri, 14 Jun 2019 10:44:49 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from <0x0meta@gmail.com>) id 1hbjhP-0001if-Ob for sox-users@lists.sourceforge.net; Fri, 14 Jun 2019 10:44:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:To:Subject:Message-ID:Date:From: MIME-Version:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=eCa3PkmgN0HzWZxPvwRIdh2sy18OY5WCcTIAPV4Z1s0=; b=L5kPLsjVu4kEfoxWbi8Kag4XHQ 9VhXZ/8C6eAYjkoqbL/nsMcAb8J2c2Q+ByicALHuR8XC8y5aENePhXAJn0Ezz/MNXClK1h3jCK8XE erLp/k23O5bOYraSwqFNs1TfiMneCWTTeLm3aVH6uKhGa1gvnzA050hMzOK8VL6b+nJU=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:To:Subject:Message-ID:Date:From:MIME-Version:Sender:Reply-To :Cc:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=eCa3PkmgN0HzWZxPvwRIdh2sy18OY5WCcTIAPV4Z1s0=; b=b fIr/uqDfK9sLDAHhP0N5MgxLLMksEiWFRqlkFYIXp3uo9Eb75G/74J/n6dyZjjkN7r3NdQHC4s6P3 500gnQ1L1G0Zh5lYjEEBegI79CW0S/CWXyA38/ExOwm9WIATAmSWgxErvWGHlLrQFqDZrKhIOKK38 tuigArjoSgI2me20=; Received: from mail-ed1-f41.google.com ([209.85.208.41]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) id 1hbjhN-00D5CY-P0 for sox-users@lists.sourceforge.net; Fri, 14 Jun 2019 10:44:47 +0000 Received: by mail-ed1-f41.google.com with SMTP id i11so2894068edq.0 for ; Fri, 14 Jun 2019 03:44:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=eCa3PkmgN0HzWZxPvwRIdh2sy18OY5WCcTIAPV4Z1s0=; b=evS7LvFfGH/IBCUVUX+M15IDDpu82qtPwDdCIVPK7mWkQ5XriuLQI+xBmH9mo5qDO/ xQ6MJGHS2H4ZSsXy9vhx25CvBP7ZOvVOsF9HkXrG0c/9LovAYbwSXBk/dAYDc86Cp7o7 8E1gEH+SoS5fZSPhd/OKaxAGKZR3qu19RwR1LHC+JOBYb4WSzzHZlf7ue2uO7CRj3l9b IKFwhNKfsfTE8DN3jndbcGTG3l0vL/bFIyUFfiYdk3rpt0hVMd2N3sO2Y3DHVlzlgEyh mAIHEFMxMHQis3aGIGyK6R814n/bCOsYFsJCOJmayRw5HP1egoG/Js00+oAo+9TOoVqJ lwng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=eCa3PkmgN0HzWZxPvwRIdh2sy18OY5WCcTIAPV4Z1s0=; b=pOeBhQYaWv/OhJdSP3UBAdntl4P2cNZGa7DfPaCNAyqbmcZHJhiSbfWXebIPMvMWqC hZVt+EfX8iLbFxeA5aGHnb/W/zFFUN8iV0YOVIXLFo5PY43Seg3tXmXemrYc1/xxyIS4 arH1ge53tyW5pwbDDuRl52AsAZ1NqemiR0a6QnkqDXTw0W+aFWjnDIi0dluGVPtSxZM5 5iZVau5GzyV/nlP6gf3ZwHW657Jyr7VUo2m4daNYRimMIgTD72AZjhGw7KF6D7Cf2ub9 2EJPuS/1rljfaoxFmuiM4BZ0pwkbrmPxB9cVe31lU7bS9A8VXdPwws1BTjnLmqvXiX77 m6aw== X-Gm-Message-State: APjAAAVjzZc1YOlAQeiPk+xz5mxN812NKw7uvLjSPsXCedqdx/gfd/WZ ODAOuTAFbTJQr5sohnXlEQv99Jw65vZuMBlXapNGaOJZ X-Google-Smtp-Source: APXvYqz1nV166Y+OcrMyiuZp9pPfiR7uKzelI4JyAUIde60qW6UQysHDqBW2mi+a/zUGKdaxbdY9Tx5xZ1wTZ8mfafg= X-Received: by 2002:a17:906:d7a8:: with SMTP id pk8mr26049262ejb.246.1560509078926; Fri, 14 Jun 2019 03:44:38 -0700 (PDT) MIME-Version: 1.0 From: "meta ." <0x0meta@gmail.com> Date: Fri, 14 Jun 2019 22:44:20 +1200 Message-ID: To: sox-users@lists.sourceforge.net X-Headers-End: 1hbjhN-00D5CY-P0 Subject: Forcing SoX to process remaining input/flush buffered output without EOF X-BeenThere: sox-users@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sox-users@lists.sourceforge.net Content-Type: multipart/mixed; boundary="===============2641404260905225285==" Errors-To: sox-users-bounces@lists.sourceforge.net --===============2641404260905225285== Content-Type: multipart/alternative; boundary="000000000000517bb6058b46559c" --000000000000517bb6058b46559c Content-Type: text/plain; charset="UTF-8" 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. --000000000000517bb6058b46559c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I want to use a sox instance that reads from stdin and wri= tes to stdout to process a continuous and potentially endless stream of aud= io blocks. The only problem is that it seems sox doesn't write to stdou= t until its buffer is filled. As a result, output blocks smaller than the b= uffer length are not accessible. Is there a way to alter this behavior usin= g 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&#= 39;m looking for. I'd like to keep the sox instance alive to process bl= ocks as needed.

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

To run, this snippet requires= the soundfile and pexpect packages to be installed, which can be done by u= sing the commands 'pip install soundfile' and 'pip install pexp= ect' in a terminal.
You'll also need to replace the path in '= ;file =3D sf.SoundFile(...)' on line 30 with one of your own, ideally a= wav.
--000000000000517bb6058b46559c-- --===============2641404260905225285== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============2641404260905225285== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Sox-users mailing list Sox-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sox-users --===============2641404260905225285==--