Dan Sully
2004-Sep-26 18:29 UTC
[Flac-dev] Finding start of audio data using metadata level 2 interface.
I'm attempting to use the metadata level 2 interface to get at the various interesting bits, which is working fine. But I also need a relevant piece of data, the offset of where the metadata ends, and the audio blocks begin. I'm not finding a clear way to reach that number. Is this exposed anywhere? Thanks. -D -- The revolution will be documented.
Josh Coalson
2004-Sep-26 21:51 UTC
[Flac-dev] Finding start of audio data using metadata level 2 interface.
--- Dan Sully <daniel@electricrain.com> wrote:> I'm attempting to use the metadata level 2 interface to get at the > various > interesting bits, which is working fine. But I also need a relevant > piece of > data, the offset of where the metadata ends, and the audio blocks > begin. I'm > not finding a clear way to reach that number. Is this exposed > anywhere?not exactly. the metadata interface won't tell you, but you can create a decoder (say file decoder), set it up, then call FLAC__file_decoder_process_until_end_of_metadata(...) FLAC__file_decoder_get_decode_position(...) and that will tell you. the decode position is relative to the start of the file even if you have an id3v2 tag in front. native FLAC's metadata system is simple enough that you could also write a custom metadata skipper pretty easily. you just have to parse the lengths out of each metadata header and skip over the blocks. Josh __________________________________ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail
Dan Sully
2004-Sep-26 23:15 UTC
[Flac-dev] Finding start of audio data using metadata level 2 interface.
* Josh Coalson <xflac@yahoo.com> shaped the electrons to say...>not exactly. the metadata interface won't tell you, but you >can create a decoder (say file decoder), set it up, then call > > FLAC__file_decoder_process_until_end_of_metadata(...) > FLAC__file_decoder_get_decode_position(...) > >and that will tell you. the decode position is relative to >the start of the file even if you have an id3v2 tag in front.Yeah, I was trying to avoid doing that. This is meant for some fast (as opposed to the current pure perl version) header parsing only code, not doing a decoder in this piece as well. It looks like FLAC__Metadata_Chain has a last_offset - but it's not exposed. That should theoretically give me the position after the last metadata block? -D -- Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind. -- Dr. Seuss
Reasonably Related Threads
- Finding start of audio data using metadata level 2 interface.
- Finding start of audio data using metadata level 2 interface.
- Finding start of audio data using metadata level 2 interface.
- Finding start of audio data using metadata level 2 interface.
- New variables "remember" how they were created?