how to interpret tell_off, and the right way to use sox_seek

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/sox-users



[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux