sox-devel@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
* sox_seek not working
@ 2013-03-25  3:13 M Junaid Muzammil
  0 siblings, 0 replies; only message in thread
From: M Junaid Muzammil @ 2013-03-25  3:13 UTC (permalink / raw)
  To: sox-devel@lists.sourceforge.net


[-- 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-03-25  3:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-25  3:13 sox_seek not working M Junaid Muzammil

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).