Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Ogg get bits per sample (Read 7532 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Ogg get bits per sample

Hi folks,
how to get from ogg file bits per sample (8bits or 16bits) ?

Ogg get bits per sample

Reply #1
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.

Ogg get bits per sample

Reply #2
10x man, I hope this is true

Ogg get bits per sample

Reply #3
Quote
10x man, I hope this is true
[a href="index.php?act=findpost&pid=366917"][{POST_SNAPBACK}][/a]

It is.  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!!

Ogg get bits per sample

Reply #4
Quote
Quote
10x man, I hope this is true
[a href="index.php?act=findpost&pid=366917"][{POST_SNAPBACK}][/a]

It is.  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!!
[a href="index.php?act=findpost&pid=366939"][{POST_SNAPBACK}][/a]


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 :/

 

Ogg get bits per sample

Reply #5
Quote
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 :/
[a href="index.php?act=findpost&pid=367167"][{POST_SNAPBACK}][/a]

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.