Help - Search - Members - Calendar
Full Version: Ogg get bits per sample
Hydrogenaudio Forums > Lossy Audio Compression > Ogg Vorbis > Ogg Vorbis - Tech
blakov
Hi folks,
how to get from ogg file bits per sample (8bits or 16bits) ?
aspifox
If you mean Vorbis, the decoded data is intrinsically floating point (libvorbis) or 16bits-or-more (Tremor), but the type of data gotten back from both the normal interfaces to these libraries is 16 bit.
blakov
10x man, I hope this is true smile.gif
john33
QUOTE(blakov @ Feb 24 2006, 03:43 PM)
10x man, I hope this is true smile.gif
*


It is. wink.gif The decoding library returns floats, so it up to the decoder frontend to decide the bit depth to write at - normally this is 16 bit integer by default. This is really what aspifox has already said!! rolleyes.gif
blakov
QUOTE(john33 @ Feb 24 2006, 11:30 AM)
QUOTE(blakov @ Feb 24 2006, 03:43 PM)
10x man, I hope this is true smile.gif
*


It is. wink.gif The decoding library returns floats, so it up to the decoder frontend to decide the bit depth to write at - normally this is 16 bit integer by default. This is really what aspifox has already said!! rolleyes.gif
*



Ok, but when I use ov_read(OggVorbis_File *vf, char *buffer, int length, int bigendianp, int word, int sgned, int *bitstream);

word
Specifies word size. Possible arguments are 1 for 8-bit samples, or 2 or 16-bit samples. Typical value is 2.

How to understand how ogg file (8bits or 16bits) is coded?

Sorry for my english :/

john33
QUOTE(blakov @ Feb 25 2006, 01:23 PM)
Ok, but when I use ov_read(OggVorbis_File *vf, char *buffer, int length, int bigendianp, int word, int sgned, int *bitstream);

word
Specifies word size. Possible arguments are 1 for 8-bit samples, or 2 or 16-bit samples. Typical value is 2.

How to understand how ogg file (8bits or 16bits) is coded?

Sorry for my english :/
*


Internally, the encoded data is in floats. If you want full flexibility, you can use ov_read_float and you'll receive the decoded data in float format so you can then do with it as you will. smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.