Sign in to follow this  

A Question About Ogg Decoding

This topic is 2566 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ogg/Vorbis supports both variable and fixed rates. In case of fixed rates you may indeed be able to deduce how much PCM-data N bytes of ogg-data would be. But why would you want to?

The Vorbis-library has a utility function ov_read, which allows you to request a number of bytes of PCM-data, and the library reads in just as much compressed data as it needs.

Share this post


Link to post
Share on other sites
Quote:
Original post by DaBono
Ogg/Vorbis supports both variable and fixed rates. In case of fixed rates you may indeed be able to deduce how much PCM-data N bytes of ogg-data would be. But why would you want to?


The idea is to have individual blocks of ogg data from multiple sounds converted into pcm data before being mixed into a single pcm buffer, which is then played. I need pcm blocks of a fixed size to mix them properly.

Share this post


Link to post
Share on other sites
Quote:
Original post by daedalic
The idea is to have individual blocks of ogg data from multiple sounds converted into pcm data before being mixed into a single pcm buffer, which is then played. I need pcm blocks of a fixed size to mix them properly.
Sure, but that doesn't mean you have to decompress exactly that much. Have a buffer for the unused results of each decompression; when you need more PCM data you pull a chunk off, and whenever there isn't enough data in the buffer for that you decompress OGG data until there is.

Share this post


Link to post
Share on other sites

This topic is 2566 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this