From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Christian Hoene" Newsgroups: gmane.comp.audio.sox.devel Subject: Bug in program or in libsox? Date: Sun, 4 Aug 2013 19:36:52 +0200 Message-ID: <000d01ce9139$35bdaef0$a1390cd0$@symonics.com> Reply-To: sox-devel@lists.sourceforge.net NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_000E_01CE9149.F948EFF0" X-Trace: ger.gmane.org 1375639434 23795 80.91.229.3 (4 Aug 2013 18:03:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 4 Aug 2013 18:03:54 +0000 (UTC) To: Original-X-From: sox-devel-bounces@lists.sourceforge.net Sun Aug 04 20:03:54 2013 Return-path: Envelope-to: gcasd-sox-devel@m.gmane.org Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of symonics.com designates 67.222.55.9 as permitted sender) client-ip=67.222.55.9; envelope-from=christian.hoene@symonics.com; helo=oproxy7-pub.bluehost.com; X-Mailer: Microsoft Outlook 14.0 Thread-Index: Ac6ROPxVv+4ckv4dTcGqx4rsz4pvog== Content-Language: de X-Identified-User: {1573:box785.bluehost.com:soniconb:symonics.com} {sentby:smtp auth 109.192.195.32 authed with christian.hoene@symonics.com} X-Spam-Score: -0.4 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [67.222.55.9 listed in list.dnswl.org] -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record 1.0 HTML_MESSAGE BODY: HTML included in message 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid X-Headers-End: 1V62ea-0001C8-SV X-BeenThere: sox-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: sox-devel-bounces@lists.sourceforge.net Xref: news.gmane.org gmane.comp.audio.sox.devel:305 Archived-At: Received: from lists.sourceforge.net ([216.34.181.88]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V62ek-00058w-Us for gcasd-sox-devel@m.gmane.org; Sun, 04 Aug 2013 20:03:51 +0200 Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1V62ee-0006st-88; Sun, 04 Aug 2013 18:03:44 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1V62ec-0006sm-Ps for sox-devel@lists.sourceforge.net; Sun, 04 Aug 2013 18:03:42 +0000 Received: from oproxy7-pub.bluehost.com ([67.222.55.9]) by sog-mx-1.v43.ch3.sourceforge.com with smtp (Exim 4.76) id 1V62ea-0001C8-SV for sox-devel@lists.sourceforge.net; Sun, 04 Aug 2013 18:03:42 +0000 Received: (qmail 24363 invoked by uid 0); 4 Aug 2013 17:36:55 -0000 Received: from unknown (HELO box785.bluehost.com) (66.147.244.85) by oproxy7.bluehost.com with SMTP; 4 Aug 2013 17:36:55 -0000 Received: from [109.192.195.32] (port=49475 helo=samsung7PC) by box785.bluehost.com with esmtpsa (TLSv1:RC4-SHA:128) (Exim 4.80) (envelope-from ) id 1V62Eh-00040Q-7E for sox-devel@lists.sourceforge.net; Sun, 04 Aug 2013 11:36:55 -0600 This is a multipart message in MIME format. ------=_NextPart_000_000E_01CE9149.F948EFF0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_000F_01CE9149.F948EFF0" ------=_NextPart_001_000F_01CE9149.F948EFF0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello, the attached program converts a file to one channel and a sampling rate of 8000. If the input is a stereo file, then the duration of the output file is half of the duration of the input file. The last half is missing. What is wrong? Thanks Christian PS: I am using sox-14.4.1 on a 64bit Ubuntu. ------=_NextPart_001_000F_01CE9149.F948EFF0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hello,

 

the attached program converts a file to one channel and a = sampling rate of 8000. If the input is a stereo file, then the duration = of the output file is half of the duration of the input file. The last = half is missing.

 

What is wrong?

 

Thanks

Christian

 

PS:
I am using sox-14.4.1 on a = 64bit Ubuntu.

 

------=_NextPart_001_000F_01CE9149.F948EFF0-- ------=_NextPart_000_000E_01CE9149.F948EFF0 Content-Type: application/octet-stream; name="example6.c" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="example6.c" /* Simple example of using SoX libraries=0A= *=0A= * Copyright (c) 2007-8 robs@users.sourceforge.net=0A= *=0A= * This program is free software; you can redistribute it and/or modify = it=0A= * under the terms of the GNU General Public License as published by the=0A= * Free Software Foundation; either version 2 of the License, or (at your=0A= * option) any later version.=0A= *=0A= * This program is distributed in the hope that it will be useful, but=0A= * WITHOUT ANY WARRANTY; without even the implied warranty of=0A= * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = General=0A= * Public License for more details.=0A= *=0A= * You should have received a copy of the GNU General Public License = along=0A= * with this program; if not, write to the Free Software Foundation, = Inc.,=0A= * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.=0A= */=0A= =0A= #ifdef NDEBUG /* N.B. assert used with active statements so enable = always. */=0A= #undef NDEBUG /* Must undef above assert.h or other that might include = it. */=0A= #endif=0A= =0A= #include "sox.h"=0A= #include =0A= #include =0A= #include =0A= =0A= /*=0A= * Reads input file, applies vol & flanger effects, stores in output = file.=0A= * E.g. example1 monkey.au monkey.aiff=0A= */=0A= int main(int argc, char * argv[])=0A= {=0A= static sox_format_t * in, * out; /* input and output files */=0A= sox_effects_chain_t * chain;=0A= sox_effect_t * e;=0A= sox_signalinfo_t outsig =3D { 8000, 1, 16, 0, NULL };=0A= char * args[10];=0A= =0A= assert(argc =3D=3D 3);=0A= =0A= /* All libSoX applications must start by initialising the SoX library = */=0A= assert(sox_init() =3D=3D SOX_SUCCESS);=0A= =0A= /* Open the input file (with default parameters) */=0A= assert(in =3D sox_open_read(argv[1], NULL, NULL, NULL));=0A= =0A= =0A= /* Open the output file; we must specify the output signal = characteristics.=0A= * Since we are using only simple effects, they are the same as the = input=0A= * file characteristics */=0A= assert(out =3D sox_open_write(argv[2], &outsig, NULL, NULL, NULL, = NULL));=0A= =0A= /* Create an effects chain; some effects need to know about the input=0A= * or output file encoding so we provide that information here */=0A= chain =3D sox_create_effects_chain(&in->encoding, &out->encoding);=0A= =0A= /* The first effect in the effect chain must be something that can = source=0A= * samples; in this case, we use the built-in handler that inputs=0A= * data from an audio file */=0A= e =3D sox_create_effect(sox_find_effect("input"));=0A= args[0] =3D (char *)in, assert(sox_effect_options(e, 1, args) =3D=3D = SOX_SUCCESS);=0A= /* This becomes the first `effect' in the chain */=0A= assert(sox_add_effect(chain, e, &in->signal, &out->signal) =3D=3D = SOX_SUCCESS);=0A= free(e);=0A= =0A= /* Create the `rate' effect, and initialise it with the desired = parameters: */=0A= e =3D sox_create_effect(sox_find_effect("rate"));=0A= assert(sox_effect_options(e, 0, NULL) =3D=3D SOX_SUCCESS);=0A= /* Add the effect to the end of the effects processing chain: */=0A= assert(sox_add_effect(chain, e, &in->signal, &out->signal) =3D=3D = SOX_SUCCESS);=0A= free(e);=0A= =0A= /* Create the `channels' effect, and initialise it with default = parameters: */=0A= e =3D sox_create_effect(sox_find_effect("channels"));=0A= assert(sox_effect_options(e, 0, NULL) =3D=3D SOX_SUCCESS);=0A= /* Add the effect to the end of the effects processing chain: */=0A= assert(sox_add_effect(chain, e, &in->signal, &out->signal) =3D=3D = SOX_SUCCESS);=0A= free(e);=0A= =0A= /* The last effect in the effect chain must be something that only = consumes=0A= * samples; in this case, we use the built-in handler that outputs=0A= * data to an audio file */=0A= e =3D sox_create_effect(sox_find_effect("output"));=0A= args[0] =3D (char *)out, assert(sox_effect_options(e, 1, args) =3D=3D = SOX_SUCCESS);=0A= assert(sox_add_effect(chain, e, &in->signal, &out->signal) =3D=3D = SOX_SUCCESS);=0A= free(e);=0A= =0A= /* Flow samples through the effects processing chain until EOF is = reached */=0A= sox_flow_effects(chain, NULL, NULL);=0A= =0A= /* All done; tidy up: */=0A= sox_delete_effects_chain(chain);=0A= sox_close(out);=0A= sox_close(in);=0A= sox_quit();=0A= return 0;=0A= }=0A= ------=_NextPart_000_000E_01CE9149.F948EFF0 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ Get your SQL database under version control now! Version control is standard for application code, but databases havent caught up. So what steps can you take to put your SQL databases under version control? Why should you start doing it? Read more to find out. http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk ------=_NextPart_000_000E_01CE9149.F948EFF0 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ SoX-devel mailing list SoX-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sox-devel ------=_NextPart_000_000E_01CE9149.F948EFF0--