-
-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Context: I'm using this library to split a FLAC file into frames, but I also need the metadata (all bytes before the first frame).
From what I understand, the current code simply drops all bytes before the first frame. Would you be open to adding an option which, if set, yields all those bytes as the first chunk?
By accessing the library internals, I can use this workaround:
const parser = new CodecParser('audio/flac')
let nrMetadataBytes = null
for await (const entry of stream) {
for (const frame of parser.parseChunk(entry)) {
if (nrMetadataBytes === null) { // First frame
nrMetadataBytes = parser._currentReadPosition - frame.data.length
}
// ... process the normal frames
}
But it's pretty ugly and inconvenient (I have to open a new readStream to actually read those bytes since they're already skipped)
Willing to create a PR if you're open to adding this (feel free to close if not)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request