iluvcapra / wavinfo

Probe WAVE Files for all metadata
https://wavinfo.readthedocs.io/
MIT License
36 stars 7 forks source link

(feature request) : `cue ` chunks #18

Closed fenugrec closed 1 year ago

fenugrec commented 1 year ago

Apparently 'cue' chunks are defined since the first 1991 specs from IBM & MS : https://www.aelius.com/njh/wavemetatools/doc/riffmci.pdf . Some recorders (at least some Tascam and Zoom handhelds) use this feature for markers : during recording, one can press a button that creates a mark at the current time.

It would be nice for wavinfo to be able to parse this chunk type, and ideally iterate over a list of cue points (would be useful for e.g. splitting a file, which is my usecase).

fenugrec commented 1 year ago

From that doc, the structure of the cue chunk is fairly simple :

// describes one cuepoint
struct cue_point {
    DWORD dwName;
    DWORD dwPosition;
    FOURCC fccChunk;
    DWORD dwChunkStart;
    DWORD dwBlockStart;
    DWORD dwSampleOffset;
}

struct cue_chunk {
    FOURCC "cue ";
    DWORD chunk_size; (the usual method)
    DWORD dwCuePoints;   // Count of cue points
    struct cue_point cue_points[dwCuePoints];
}

Attached is an example wav file with this type of metadata : STE-000.wav.zip

iluvcapra commented 1 year ago

This is a great suggestion, thanks for brining it up!

iluvcapra commented 1 year ago

It's funny I wrote most of the Hex Fiend template for this (including parsing the cue chunk but never got around to putting it into this package.

https://github.com/HexFiend/HexFiend/blame/b031c7c3220ade86790d19dc57994640f1a2d9ce/templates/Audio/WAV.tcl#L3

I'll also include the labl an ltxr chunks because those get used by a couple apps I use too, like Isotope.

iluvcapra commented 1 year ago

Implementation currently happening in #19

iluvcapra commented 1 year ago

This is done on PR #19 if you'd like to check it out for yourself, otherwise I will merge it into master and build a new release in a day or two if you don't have any notes!

fenugrec commented 1 year ago

Wow that was fast. You also went way beyond just parsing the cue chunks, nice.

iluvcapra commented 1 year ago

Fixed in v2.3.0 and #19