Vorbisfile documentation

libVorbisfile version 1.65 - 20020702

ov_read()

declared in "vorbis/vorbisfile.h";  "vorbis/vorbisfile.h"で定義されている

This is the main function used to decode a Vorbis file within a loop. It returns up to the specified number of bytes of decoded PCM audio in the requested endianness, signedness, and word size. If the audio is multichannel, the channels are interleaved in the output buffer. If the passed in buffer is large, ov_read() will not fill it; the passed in buffer size is treated as a limit and not a request.
これはループ内でVorbisファイルをデコードするのに使うメインの関数である。 要求されたエンディアン、符号の有無、1ワードのサイズでデコードされた PCM音声データのバイト数を返す。 音声が複数チャンネルであるなら、チャンネルは出力バッファにインターリーブされる。 渡されたバッファサイズが大きいとき ov_read() はすべてを満たさないかもしれない。 渡されたバッファサイズは要求量ではなく、限界量として扱われる。

Note that up to this point, the Vorbisfile API 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 reading audio back, the application must be aware that multiple bitstream sections do not necessarily use the same number of channels or sampling rate.
以下の点に注意。 Vorbisfile APIは、もし最上位アプリケーションが特に気にしないなら、 最上位のアプリケーションから複数の論理ビットストリームの結合の性質を多少隠蔽する。 しかしながら、バックして音声を読むとき、アプリケーションは 複数のビットストリームセクションは同じチャンネル数やサンプリングレートでは ないかもしれないことを覚えておくこと。

ov_read() passes back the index of the sequential logical bitstream currently being decoded (in *bitstream) along with the PCM data in order that the toplevel application can handle channel and/or sample rate changes. This number will be incremented at chaining boundaries even for non-seekable streams. For seekable streams, it represents the actual chaining index within the physical bitstream.
ov_read() は 最上位のアプリケーションがチャンネルやサンプリングレートの変更を扱うことができるように、 現在デコードしているPCMデータが所属する、連続した論理ビットストリームのインデックスを(*bitstreamに)返す。 移動不可能なストリームでは、この番号は結合の境界線で増加する。 移動可能なストリームでは、物理ビットストリームの中での実際の結合インデックスを表す。




long ov_read(OggVorbis_File *vf, char *buffer, int length, int bigendianp, int word, int sgned, int *bitstream);

Parameters

vf
A pointer to the OggVorbis_File structure--this is used for ALL the externally visible libvorbisfile functions.
OggVorbis_File構造体へのポインタ。 これはすべての対外的に可視であるlibvorbisfileの関数で使用される。
buffer
A pointer to an output buffer. The decoded output is inserted into this buffer.
出力バッファへのポインタ。デコードされた結果はこのバッファに挿入される。
length
Number of bytes to be read into the buffer. Should be the same size as the buffer. A typical value is 4096.
読み込むためのバッファのバイト数。バッファと同じサイズであるべきだ。一般的な値は4096。
bigendianp
Specifies big or little endian byte packing. 0 for little endian, 1 for b ig endian. Typical value is 0.
バイトオーダーがビッグエンディアンかリトルエンディアンかを特定する。 リトルエンディアンは0、ビッグエンディアンは1。通常の値は0。
word
Specifies word size. Possible arguments are 1 for 8-bit samples, or 2 or 16-bit samples. Typical value is 2.
1ワードのサイズを特定する。指定可能な引数は、8ビットサンプルで1か、 16ビットサンプルで2である。一般的な値は2。
sgned
Signed or unsigned data. 0 for unsigned, 1 for signed. Typically 1.
符号付きデータか符合なしデータか。符号なしは0、符号付きは1。普通は1。
bitstream
A pointer to the number of the current logical bitstream.
現在の論理ビットストリームの番号へのポインタ

Return Values

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)
データの中に割り込みがあったことを示す。 (これらの1つ:ページの間にゴミ、再録音による同期失敗、間違ったページ)
OV_EBADLINK
indicates that an invalid stream section was supplied to libvorbisfile, or the requested link is corrupt.
無効なストリームセクションがlibvorbisfileに提供されたか、要求されたリンクが間違っていることを示す。
0
indicates EOF  EOFを示す
n
indicates actual number of bytes read. ov_read() will decode at most one vorbis packet per invocation, so the value returned will generally be less than length.
実際に読み込んだバイト数を示す。ov_read()は呼出しごとに 最大で1つのVorbisパケットしかデコードしないため、 返ってくる値は通常 length より小さい。

Notes

Typical usage: 典型的な使い方

bytes_read = ov_read(&vf, buffer, 4096,0,2,1,&current_section)
This reads up to 4096 bytes into a buffer, with signed 16-bit little-endian samples.
この場合、符号付き16ビットリトルエンディアンのサンプルとして最大4096バイトをバッファに読み込む。




copyright © 2002 Xiph.org

Ogg Vorbis

Vorbisfile documentation

libVorbisfile version 1.65 - 20020702