sox-users@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
* how to interpret tell_off, and the right way to use sox_seek
@ 2017-11-04  7:26 Dan Hitt
  2017-11-06 11:10 ` Jan Stary
  0 siblings, 1 reply; 11+ messages in thread
From: Dan Hitt @ 2017-11-04  7:26 UTC (permalink / raw)
  To: sox-users

I'm on a debian stretch box, using what i imagine is version 14, 4, 1
based on sox.h (SOX_LIB_VERSION(14, 4, 1)).

I need to seek back and forth in a file, ultimately reading the same
samples multiple times.

When i seek backwards, via a call to sox_seek(*,*, SOX_SEEK_SET) with
an offset less than the current position, the file pointer is moved,
according to ftell() applied to ->fp in the sox format structure.

But the ->tell_off field doesn't budge.

And then when i've hauled out a count of samples equal to what the
file holds (but nowhere near the end of the file, according to
ftell()) i get this error message about a premature end of the file,
and my reading stops.

Because of the great age of sox this can hardly be an unknown effect
but i can't find any mention of it on google.

So . . . what's the best way to handle it?

Should i go in and manhandle the ->tell_off field to match what i
think it should be?

Or should i reopen the file each time it has gone through its quota of samples?

Or maybe i'm just crazily wrong and i have to do something extra for sox_seek?

Anyhow, would appreciate any advice, especially if it sounds like i'm
just not making the call right.

TIA!!

dan

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-11-07  9:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-04  7:26 how to interpret tell_off, and the right way to use sox_seek Dan Hitt
2017-11-06 11:10 ` Jan Stary
2017-11-06 18:08   ` Dan Hitt
2017-11-06 19:06     ` Jan Stary
2017-11-06 20:14       ` Dan Hitt
2017-11-06 21:09         ` Jan Stary
2017-11-06 21:47           ` Dan Hitt
2017-11-07  8:50             ` Jan Stary
2017-11-07  9:01               ` Jan Stary
2017-11-07  9:13                 ` Jan Stary
2017-11-07  9:22                   ` Jan Stary

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