From: M Junaid Muzammil <m_junaid_muzammil@yahoo.com>
To: "sox-devel@lists.sourceforge.net" <sox-devel@lists.sourceforge.net>
Subject: sox_seek not working
Date: Sun, 24 Mar 2013 20:13:57 -0700 (PDT) [thread overview]
Message-ID: <1364181237.60042.YahooMailNeo@web121103.mail.ne1.yahoo.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 1240 bytes --]
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?
[-- Attachment #1.2: Type: text/html, Size: 2041 bytes --]
[-- Attachment #2: Type: text/plain, Size: 238 bytes --]
------------------------------------------------------------------------------
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
[-- Attachment #3: Type: text/plain, Size: 158 bytes --]
_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel
reply other threads:[~2013-03-25 3:14 UTC|newest]
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.sourceforge.net/lists/listinfo/sox-devel
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1364181237.60042.YahooMailNeo@web121103.mail.ne1.yahoo.com \
--to=sox-devel@lists.sourceforge.net \
--cc=m_junaid_muzammil@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/sox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).