From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: M Junaid Muzammil Newsgroups: gmane.comp.audio.sox.devel Subject: sox_seek not working Date: Sun, 24 Mar 2013 20:13:57 -0700 (PDT) Message-ID: <1364181237.60042.YahooMailNeo@web121103.mail.ne1.yahoo.com> Reply-To: M Junaid Muzammil , sox-devel@lists.sourceforge.net NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3186232546829599747==" X-Trace: ger.gmane.org 1364181255 23244 80.91.229.3 (25 Mar 2013 03:14:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 Mar 2013 03:14:15 +0000 (UTC) To: "sox-devel@lists.sourceforge.net" Original-X-From: sox-devel-bounces@lists.sourceforge.net Mon Mar 25 04:14:42 2013 Return-path: Envelope-to: gcasd-sox-devel@m.gmane.org X-ACL-Warn: X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 780332.34669.bm@omp1009.mail.ne1.yahoo.com X-YMail-OSG: mc0DX9EVM1mEUWhap1DSK4tfmMxqQ0tTDpO79rS0I5gXUWD uHrLiXm4i8Gubjr.HHUz7r2dB.LN3cow.NhudPR2ydH0nIqsyKWUT0HwsPIi WKfBLgvSX57.uRZ2VdJ6BH6ubXYnI7n5UCCVmrOtpc7tBpntvI2CDski_T6s lGBV_1BTNZKYMzVw8vscHY0wFXGJhki4dO4fhTndPYeCem4a.nQovItai6zp YLxFg1Tr7pkmAVEIkKlEkt5OXk2o1INJUHO5nofTVTzivPS0odOvZcpHtXv5 RC7VaJjs_QlkphS2z4o3ErnAzAvMnNEtXxdPhXPRWF6PBYwDkuCPi4V3IhI0 lw.UXHR6.G9O5bqSnagnNTcqyKGL597e6eWJ8z8CfbwmkUaCSawwLZ88H0zB d855uMYXojPOvkDShCnfzPqcIrh4XX.eMe8KK7JQ7NxywxPR.zOVrBXS3uSJ hC0UW2XtHuMzywHZF9Sf9oRax3HbNhbvK2P.OE16cng-- X-Rocket-MIMEInfo: 002.001, IEkgYW0gbG9va2luZyB0byBkZXZlbG9wIGFuIGF1ZGlvIHBsYXllciB0aGF0IHJlcGV0aXRpdmVseSBwbGF5cyBhdWRpbyBmaWxlcy4gSSBhbSB1c2luZyB0aGUgc294IGxpYnJhcnkuIEkgaGF2ZSB0cmllZCB0aGUgZm9sbG93aW5nIGNvZGUgc25pcHBldCBidXQgaXQgb25seSBwbGF5cyB0aGUgYXVkaW8gZmlsZSBvbmNlIGFuZCBkb2Vzbid0IHBsYXkgaXQgbmV4dCB0aW1lLiAKaW50IG1haW4oaW50IGFyZ2MsIGNoYXIgKmFyZ3ZbXSkKeyBpZiAoYXJnYyAhPSA0KSB7IHByaW50ZiAoIkluY29ycmVjdCBBcmcBMAEBAQE- X-Mailer: YahooMailWebService/0.8.138.524 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 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (m_junaid_muzammil[at]yahoo.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [98.138.91.93 listed in list.dnswl.org] -1.3 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 1.0 HTML_MESSAGE BODY: HTML included in message -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1UJxrH-00086C-6f 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:282 Archived-At: Received: from lists.sourceforge.net ([216.34.181.88]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UJxrt-0007Mk-S4 for gcasd-sox-devel@m.gmane.org; Mon, 25 Mar 2013 04:14:42 +0100 Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1UJxrK-00019b-Fh; Mon, 25 Mar 2013 03:14:06 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1UJxrJ-00019W-6B for sox-devel@lists.sourceforge.net; Mon, 25 Mar 2013 03:14:05 +0000 Received: from nm17-vm2.bullet.mail.ne1.yahoo.com ([98.138.91.93]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1UJxrH-00086C-6f for sox-devel@lists.sourceforge.net; Mon, 25 Mar 2013 03:14:05 +0000 Received: from [98.138.90.53] by nm17.bullet.mail.ne1.yahoo.com with NNFMP; 25 Mar 2013 03:13:57 -0000 Received: from [98.138.87.9] by tm6.bullet.mail.ne1.yahoo.com with NNFMP; 25 Mar 2013 03:13:57 -0000 Received: from [127.0.0.1] by omp1009.mail.ne1.yahoo.com with NNFMP; 25 Mar 2013 03:13:57 -0000 Received: (qmail 63961 invoked by uid 60001); 25 Mar 2013 03:13:57 -0000 Received: from [110.37.6.124] by web121103.mail.ne1.yahoo.com via HTTP; Sun, 24 Mar 2013 20:13:57 PDT --===============3186232546829599747== Content-Type: multipart/alternative; boundary="-1109850712-1048513245-1364181237=:60042" ---1109850712-1048513245-1364181237=:60042 Content-Type: text/plain; charset=us-ascii I am looking to develop an audio player that repetitively plays audio files. I am using the sox library. I have tried the following code snippet but it only plays the audio file once and doesn't play it next time. int main(int argc, char *argv[]) { if (argc != 4) { printf ("Incorrect Arguments\n"); exit (-1); } int i, sox_status, status; /* Sox File Descriptor */ sox_format_t *sox_fd1, *sox_fd2; size_t sox_size = 1, sox_tsize = 0; sox_sample_t sox_buf[1000]; sox_uint64_t seek = 0; /* Initialization of all format handlers */ sox_format_init (); /* Open Wav file for reading */ sox_fd1 = sox_open_read (argv[1], NULL, NULL, "wav"); sox_fd2 = sox_open_write ("default", &sox_fd1->signal, NULL, "alsa", NULL, NULL); for (i = 0; i < 5; i++) { while (sox_size) { sox_size = sox_read (sox_fd1, sox_buf, 100000); sox_write (sox_fd2, sox_buf, sox_size); } sox_size = 1; sox_status = sox_seek (sox_fd1, 0L, SOX_SEEK_SET); } /* Close Wav file */ sox_close (sox_fd1); sox_close (sox_fd2); /* De-initialization of f ile format handlers */ sox_format_quit (); return 0; } It seems that sox_seek is not functioning properly, but the function sox_seek returns successfully. What can be the problem? ---1109850712-1048513245-1364181237=:60042 Content-Type: text/html; charset=us-ascii
I am looking to develop an audio player that repetitively plays audio files. I am using the sox library. I have tried the following code snippet but it only plays the audio file once and doesn't play it next time.
int main(int argc, char *argv[])
{

        if (argc != 4) {
                printf ("Incorrect Arguments\n");
                exit (-1);
        }


        int i, sox_status, status;
        /*      Sox File Descriptor     */
        sox_format_t *sox_fd1, *sox_fd2;

        size_t sox_size = 1, sox_tsize = 0;

        sox_sample_t sox_buf[1000];
        sox_uint64_t seek = 0;
        /*      Initialization of all format handlers   */
        sox_format_init ();
        /*      Open Wav file for reading       */
        sox_fd1 = sox_open_read (argv[1], NULL, NULL, "wav");
        sox_fd2 = sox_open_write ("default", &sox_fd1->signal, NULL, "alsa", NULL, NULL);

        for (i = 0; i < 5; i++) {

           while (sox_size) {
                sox_size = sox_read (sox_fd1, sox_buf, 100000);
                sox_write (sox_fd2, sox_buf, sox_size);
           }
                sox_size = 1;
                sox_status = sox_seek (sox_fd1, 0L, SOX_SEEK_SET);
        }

        /*      Close Wav file  */
        sox_close (sox_fd1);
        sox_close (sox_fd2);

        /*      De-initialization of file format handlers       */
        sox_format_quit ();
        return 0;
}
It seems that sox_seek is not functioning properly, but the function sox_seek returns successfully. What can be the problem?
---1109850712-1048513245-1364181237=:60042-- --===============3186232546829599747== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_mar --===============3186232546829599747== 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 --===============3186232546829599747==--