vorbisfile documentation |
vorbisfile version 1.25 - 20000615 |
declared in "vorbis/vorbisfile.h";
This is the main function used to decode a Vorbis file within a loop.
This function deals with more complicated bitstream chaining issues. Up to this point, everything could more or less hide the multiple logical bitstream nature of chaining from the toplevel application if the toplevel application didn't particularly care. However, when we actually read audio back, we must be aware that multiple bitstream sections do not necessarily have to have the same number of channels or sampling rate.
ov_read returns the sequential logical bitstream number currently being decoded along with the PCM data in order that the toplevel application can take action on channel/sample rate changes. This number will be incremented even for streamed (non-seekable) streams For seekable streams, it represents the actual logical bitstream index within the physical bitstream.
long ov_read(OggVorbis_File *vf, char *buffer, int length, int bigendianp, int word, int sgned, int *bitstream); |
OV_HOLE indicates there was an interruption in the data. (one of: garbage between pages, loss of sync followed by recapture, or a corrupt page) OV_EBADLINK indicates that an invalid stream section was supplied to libvorbisfile, or the requested link is corrupt. 0 indicates EOF n indicates actual number of bytes read. Within a logical bitstream, the number should equal length. At the end of a logical bitstream, the number of bytes read will equal the remaining number of bytes in the bitstream.
Typical usage: bytes_read = ov_read(&vf, buffer, 4096,0,2,1,¤t_section)
This reads up to 4096 bytes into a buffer, with signed 16-bit little-endian
samples.
copyright © 2000 vorbis team |
|
vorbisfile documentation |
vorbisfile version 1.25 - 20000615 |