Vorbisfile documentation |
libVorbisfile version 1.65 - 20020702 |
Decoding
All libvorbisfile decoding routines are declared in "vorbis/vorbisfile.h".
すべてのlibvorbisfileのデコードルーティンは"vorbis/vorbisfile.h"で定義されている。
After initialization, decoding audio
is as simple as calling ov_read(). This
function works similarly to reading from a normal file using
read().
初期化 の後、音声のデコードには単純に ov_read() を呼ぶだけだ。
この関数は普通のファイルから read() を使って読み込むのと同じような働きをする。
However, a few differences are worth noting:
しかしながら、いくつかの違いは注意する必要がある。
multiple stream links
A Vorbis stream may consist of multiple sections (called links) that
encode differing numbers of channels or sample rates. It is vitally
important to pay attention to the link numbers returned by ov_read and handle audio changes that may
occur at link boundaries. Such multi-section files do exist in the
wild and are not merely a specification curiosity.
Vorbisストリームはチャンネル数やサンプリングレートの異なるエンコードをした
複数のセクション(リンクと呼ばれる)からなる。
これはとても重要で ov_read が返すリンクナンバーに注意をはらい、
リンク境界で見られる音声の変化を扱う必要がある。
このようなマルチセクションのファイルは普通は存在せず、単なる不思議な仕様にすぎない。
returned data amount
ov_read does not attempt to completely fill
a large, passed in data buffer; it merely guarantees that the passed
back data does not overflow the passed in buffer size. Large buffers
may be filled by iteratively looping over calls to ov_read (incrementing the buffer pointer)
until the original buffer is filled.
ov_read はデータバッファを完全に満たすわけではない。
返ってくるデータはバッファサイズを超えてオーバフローしないことだけ保証されている。
大きなバッファでは、データを満たすために、(バッファポインタを増加させながら)ov_read を繰り返し呼ぶことになるだろう。
file cursor position
Vorbis files do not necessarily start at a sample number or time offset
of zero. Do not be surprised if a file begins at a positive offset of
several minutes or hours, such as would happen if a large stream (such
as a concert recording) is chopped into multiple seperate files.
Vorbisファイルはサンプル番号/時間が0で始まっていないかもしれない。
もしファイルが何分、何時間という正の位置から始まっていても驚くな。
こんなことは(コンサートの録音データのように)大きなストリームが複数のファイルに分割されているときなどに起こり得る。
function |
purpose |
ov_read |
This function makes up the main chunk of a decode loop. It takes an
OggVorbis_File structure, which must have been initialized by a previous
call to ov_open().
この関数はデコードループのメインの部分を作る。
あらかじめ ov_open() を呼び出すことで初期化されたOggVorbis_File構造体を渡す。
|
ov_read_float |
This function decodes to floats instead of integer samples.
この関数は整数の代わりに浮動少数にデコードする。
|
copyright © 2002 Xiph.org |
Ogg Vorbis |
Vorbisfile documentation |
libVorbisfile version 1.65 - 20020702 |