[vorbis-dev] Finding size of decoded data
Gustavo Aranda
maulo at exelweiss.com
Tue Oct 22 02:29:45 PDT 2002
In order to find how many bytes of pcm raw data you'd get after decoding
a vorbis file, I use the "ov_pcm_total" function:
pcm_raw_buffer_size = (long)ov_pcm_total(&vf,-1) *4 ;
The "*4" is needed for stereo 16 bits streams. Other kind of streams
shall need other values.
I get it is "NUMBER_OF_CHANNELS * BITRATE/8" , where BITRATE is usually
8 or 16 bits.
Gustavo Aranda
Sound Programmer
Exelweiss Entertainment SL
maulo at exelweiss.com
<p>Eric Fortier escribió::
>Hi all,
>
>This is a newbie question, but I can't seem to find an answer to it.
>
>I want to know if it's possible to find out, or compute, the total PCM decoded
>size of a coded vorbis sound file.
>
>What I'm trying to do is decode all data to a buffer, but I don't know how
>to allocate the buffer. Worst case I could do some kind of smaller buffer
>list, but I would prefer not to, as it would degrade performance.
>
>Thanks for any help.
>
>--Eric
>
>
>--- >8 ----
>List archives: http://www.xiph.org/archives/
>Ogg project homepage: http://www.xiph.org/ogg/
>To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
>containing only the word 'unsubscribe' in the body. No subject is needed.
>Unsubscribe messages sent to the list will be ignored/filtered.
>
>
>
>
<p><p>--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the Vorbis-dev
mailing list