0

I have a flac file and I have to do some analysis on the waveform looking for a particular sample. So I decompressed them in PCM data, but then I need to know, where is that particular sample in the flac file.

So: I know the byte offset in the PCM data, or in a wav file, and I want to know the byte offset of the compressed sample in the flac file.

How can I do?

fortea
  • 345
  • 4
  • 15

1 Answers1

1

You can probably trace the sample back to the frame in the FLAC file. Within that frame would be more difficult if you consider the audio may have multiple channels and is generally compressed. If you look at the flac spec, I think it should be pretty easy to parse the file yourself:

http://flac.sourceforge.net/format.html

And you probably have to decode each frame in order to know what the frame length is...

GogglesGuy
  • 157
  • 4