Open psibre opened 8 years ago
@psibre
I think sox
slice differently from what i am currently doing, for instance i slice with sox
say first 4 seconds, and with our current program. I get slight differences between the files, however when you play you clearly see they start at same point and have same duration as specifies
SOX slicing first 4 seconds: File Size: 264.6KB , Samples length: 132300
POC slicing first 4 seconds: File Size: 267.3KB, Samples length: 133632
This is just a visual comparison thus the test will never pass, however i don't know if my calculations are off (Looking into that).
2.
I have been trying to figure out this Stream Sync
problem, i know that the exception is thrown from jflac
library but why i am yet to figure out, however if you have any insight that might change my thinking or approach towards debugging this please let me know.
Let's do this:
This may be a feasible solution.
The method to decode by passing sample number will not work because, we don't know the Streamoffset, or which frames our seekpoints overlap into. However, after creating the seekpoints, we know that the ordering and thus get the seekpoint
based on index number in the seektable
.
Once that is gotten, we can thus get the samplenumber
, streamoffset
and framesamples
to create the seekpoints to and from thus decoding only those segments.
The tests for this slices is not per-say the best, because i couldnt find a tool that can slice the flac file based on number of samples, so i instead test against if the file is readable or corrupted. But i also manually analysed the sliced files to make sure they are not just corrupted files.
We need to be able to decode specific time spans, either by sample numbers or timestamps (in seconds or similar) from the FLAC.