I have a couple of questions with respect to "vorbisfile_example.c" in the ov sdk. 1) Near the end, there is a comment that says "we don't bother dealing with sample rate changes, etc, but you'll have to." I assume the author is regarding to different sample rates as a whole, not dynamic sample rates. Am I correct in that assumption? 2) That etc bothers me. Are there other things I should keep an eye out for? I can't seem to think of any. 3) At the top, he says that using vorbisfile is easier than using libvorbis. Is there any advantage to using libvorbis? I honestly can't see one, unless one needs access to raw functions for some reason. With respect to the "encoder_example" why do you use a random number for the stream rather than just starting at some arbitrary number (zero or otherwise) and increment. The only viable reason I can assume is to prevent logical streams becoming mixed because of bad transfer. Is there some other reason? Thanks, Christopher -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/vorbis-dev/attachments/20050616/ec10bcb3/attachment.html
On Thu, Jun 16, 2005 at 10:55:02AM -0500, Christopher Egner wrote:> 1) Near the end, there is a comment that says "we don't bother dealing > with sample rate changes, etc, but you'll have to." I assume the author is > regarding to different sample rates as a whole, not dynamic sample rates. Am > I correct in that assumption?The sample rate and number of channels is fixed for any chain segment, but there can be chain boundaries in the file (where the serial number changes) and at those boundaries playback may switch to a different sample rate and/or number of channels. A real application must handle those cases. That is what that comment is about.> 2) That etc bothers me. Are there other things I should keep an eye > out for? I can't seem to think of any.Number of channels and metadata comments changing are the main things the etc. refers to, but anything associated with stream decoding can change, so if you're doing something subtle with frame lengths or something, you also have to reset that when vorbisfile notifies you of a chain boundary.> > 3) At the top, he says that using vorbisfile is easier than using > libvorbis. Is there any advantage to using libvorbis? I honestly can't see > one, unless one needs access to raw functions for some reason.vorbisfile only handles degenerate (vorbis-only) ogg streams, so if you have vorbis multiplexed with another codec, or in another container you have to use libvorbis directly.> With respect to the "encoder_example" why do you use a random number for the > stream rather than just starting at some arbitrary number (zero or > otherwise) and increment. The only viable reason I can assume is to prevent > logical streams becoming mixed because of bad transfer. Is there some other > reason?Laziness? Always choosing a random serialno reduces the chance of collision if the segments are rechained, but really it's the encoder or remixer's job to ensure there are no collisions within a particular stream. I guess using the same number all the time also feels like the wrong kind of laziness. Hope that helps, -r
On Thu, Jun 16, 2005 at 10:55:02AM -0500, Christopher Egner wrote:> I have a couple of questions with respect to "vorbisfile_example.c" in the > ov sdk. > > > > 1) Near the end, there is a comment that says "we don't bother dealing > with sample rate changes, etc, but you'll have to." I assume the author is > regarding to different sample rates as a whole, not dynamic sample rates. Am > I correct in that assumption?No; Chained vorbis files can change sample rates dynamically from link to link.> 2) That etc bothers me. Are there other things I should keep an eye > out for? I can't seem to think of any.No, that's the only big one.> 3) At the top, he says that using vorbisfile is easier than using > libvorbis. Is there any advantage to using libvorbis? I honestly can't see > one, unless one needs access to raw functions for some reason.Not really; certainly not unless there's something very specific you need to do that vorbisfile can't do.> With respect to the "encoder_example" why do you use a random number for the > stream rather than just starting at some arbitrary number (zero or > otherwise) and increment. The only viable reason I can assume is to prevent > logical streams becoming mixed because of bad transfer. Is there some other > reason?If you construct a file of two links witht he same serialnumber (eg, using cat), the file won't work. The random serialno just makes it highly likley that the act of chaining two vorbis files into one will be a trivial operation (as opposed to re-paging one of the files). Monty