0

The Ogg bitstream format is composed of sequential pages. Each page has a header with metadata (the checksum of the page, the length of the page, etc). One such piece of metadata is the page sequence number, which starts at 0 for the first page in the stream and increases by 1 for every successive page (allowing streams to be checked for missing pages).

One page that can exist in Ogg streams is a Vorbis comment page. This page contains a Vorbis comment block, which is usually used to encode media tags like title, artist, or album.

In a project I'm working on, I need to be able to add Vorbis comments to Ogg files. If the comment page already exists, editing the comments only requires changing metadata for the page containing them (length, checksum, etc). But if the comment page needs to be created, then it will need to be assigned the appropriate sequence number, meaning that every single page after it must have its sequence number incremented.

Is there something I'm missing, or a better way to deal with adding pages? Or is changing each sequence number the only way to insert a page?

1 Answers1

0

It turns out that for all of the major codecs that use Ogg as a container (Vorbis, Opus, Theora, Speex, and FLAC), the existence of a comment page is actually part of the specification of the Ogg mapping, so the page will never need to be created.