Package org.lwjgl.stb

Class STBVorbis

java.lang.Object
org.lwjgl.stb.STBVorbis

public class STBVorbis extends Object
Native bindings to stb_vorbis.c from the stb library.

Ogg Vorbis audio decoder.

Limitations

  • floor 0 not supported (used in old ogg vorbis files pre-2004)
  • lossless sample-truncation at beginning ignored
  • cannot concatenate multiple vorbis streams
  • sample positions are 32-bit, limiting seekable 192Khz files to around 6 hours (Ogg supports 64-bit)

THREAD SAFETY

Individual stb_vorbis* handles are not thread-safe; you cannot decode from them from multiple threads at the same time. However, you can have multiple stb_vorbis* handles and decode from them independently in multiple threads.

PUSHDATA API

This API allows you to get blocks of data from any source and hand them to stb_vorbis. you have to buffer them; stb_vorbis will tell you how much it used, and you have to give it the rest next time; and stb_vorbis may not have enough data to work with and you will need to give it the same data again PLUS more. Note that the Vorbis specification does not bound the size of an individual frame.

PULLING INPUT API

This API assumes stb_vorbis is allowed to pull data from a source -- either a block of memory containing the _entire_ vorbis stream, or a FILE * that you or it create, or possibly some other reading mechanism if you go modify the source to replace the FILE * case with some kind of callback to your code. (But if you don't support seeking, you may just want to go ahead and use pushdata.)