Gordon Harris wrote:
....
But, in terms of the need to use flac.exe to transcode individual tracks from
flacs: I guess Iâm just not getting what the problem is with writing the perl
code to seek to the appropriate place in a whole-disc/cue-embeded flac file.
(Forgive me if Iâm speculating above my pay-grade here: Iâve never written a
single line of perl code.) If a flac file has a cuesheet-metadata-block, flac
version 1.1.2 allows one to use cuepoints to decode a portion of the flac
file. So, rather than using the "âskip=mm:ss.ss âuntil=mm:ss.ss" command line
form, one can use "âcue=n.n-n.n" to select a specific track/index range to
decode. I assume that this means that flac.exe isnât having to use any sort
of "time to byte-offset" calculation to seek to the appropriate section of the
flac file. The cuesheet-metatdata-block includes sample offsets from the
beginning of the flac audio stream for each track and index in the cuesheet
metadata. Personally, Iâve never figured out how to convert a sample offset
into a byte offset, but, how hard could it be?
For FLAC embedded cuesheets, we should be able to get exact seekpoints
from the STREAMINFO header. This header is easily parseable in Perl - in
fact Michael Turner recently added seekpoint parsing code to our FLAC
formatting package. For external cuesheets, however, a
time-to-byte-offset calculation is necessary. This translation is fairly
hairy as it is (it involves an initial guess based on bitrate and then
frame parsing to find the exact point), and has the potential to be slow
in Perl. That being said, our longer term solution may be to implement
the seeking code entirely in Perl - it just hasn't happened yet.
--Vidur
_______________________________________________
Discuss mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/discuss