Skip to main content

Topic: FLAC reported length (Read 1312 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
FLAC reported length
Any ideas on how to change the reported length (time) of a FLAC file? Basically, I want to hide content at the end of the file.
Project Leader of DDResampled

  • saratoga
  • [*][*][*][*][*]
Re: FLAC reported length
Reply #1
I think you could edit the samples field in the METADATA_BLOCK_STREAMINFO block:

https://xiph.org/flac/format.html

Some software may still be able to seek to the hidden audio though.

Re: FLAC reported length
Reply #2
Thanks. That does look like what I'm looking for. But after looking around for tools and trying to open a FLAC in a HEX editor, it's evident that this is currently over my head. Any way I can be pointed in the right direction on how to figure out how to do that?
Project Leader of DDResampled

  • saratoga
  • [*][*][*][*][*]
Re: FLAC reported length
Reply #3
Right direction meaning an existing tool to do this?  I don't know why that would exist.  I think you'll have to work it out from the spec or the flac source code.

Re: FLAC reported length
Reply #4
Thanks again. I figured it out. For reference, the reported length in samples should be the 2nd half of HEX block 15 through 19 (in total 36 bits) in any standard FLAC file.

Unfortunately, what I hoped would be the case, where the player would continue to play beyond the reported length, appears to not be standard player behavior. Oddly, the file integrity scanner does find a reported length mismatch, but appears to ignore all blocks beyond the reported length, finding only a fraction of a second difference despite an actual difference of a few minutes. Also, the displayed bitrate takes into account the entire file and not just the reported length.
  • Last Edit: 27 October, 2017, 03:35:39 AM by CyberTootie
Project Leader of DDResampled

  • Porcus
  • [*][*][*][*][*]
Re: FLAC reported length
Reply #5
Does it have to be at the "rear end"? ;)  I wonder if you can hide it in a padding block?
It would be easily lost though.

Edit: METADATA_BLOCK_APPLICATION, maybe?  There was an apparently short-lived utility that would attach anything in that block: https://directory.fsf.org/wiki/FlacFile ... and others too, I see.
  • Last Edit: 27 October, 2017, 04:54:42 AM by Porcus

Re: FLAC reported length
Reply #6
I was aiming for a kind of "hidden track"-type functionality where the player would report a length but would continue to play beyond said length.
Project Leader of DDResampled