Vorbisfile documentation

libVorbisfile version 1.65 - 20020702

ov_open

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

This is the main function used to open and initialize an OggVorbis_File structure. It sets up all the related decoding structure.
これはOggVorbis_File構造体を初期化して開くのにメインの関数である。 すべての関連するデコード構造体を準備する。

The first argument must be a file pointer to an already opened file or pipe (it need not be seekable--though this obviously restricts what can be done with the bitstream). vf should be a pointer to the OggVorbis_File structure--this is used for ALL the externally visible libvorbisfile functions. Once this has been called, the same OggVorbis_File struct should be passed to all the libvorbisfile functions.
第一引数は必ずすでに開かれたファイルかパイプ(移動可能でなくてよい―― たとえそれがビットストリームで可能なことを制限するとしても)へのポインタでなければならない。 vf はOggVorbis_File構造体(これはすべての対外的に可視であるlibvorbisfileの関数で使用される)へのポインタでなければならない。 一度この関数が呼ばれると同じ OggVorbis_File構造体が すべてのlibvorbisfileの関数に渡されなければならない。

Also, you should be aware that ov_open(), once successful, takes complete possession of the file resource. After you have opened a file using ov_open(), you MUST close it using ov_clear(), not fclose() or any other function.
また、ov_open() がひとたび成功すればファイルを占有することに注意すべきだ。ov_open() を使ってファイルを開いた後は、fclose()やその他の関数ではなく、必ず ov_clear() を使ってファイルを閉じなければならない。

It is often useful to call ov_open() simply to determine whether a given file is a vorbis bitstream. If the ov_open() call fails, then the file is not recognizable as such. When you use ov_open() for this, you should fclose() the file pointer if, and only if, the ov_open() call fails. If it succeeds, you must call ov_clear() to clear the decoder's buffers and close the file for you.
ov_open() の呼び出しは単にファイルがビットストリームであるか判断するのに便利である。 もし ov_open() の呼び出しが失敗すればファイルがそのように認識できなかったということだ。 このために ov_open() を使うときで、かつ、ov_open() の呼び出しが失敗したときのみ、ファイルポインタを fclose() すべきだ。 もし成功したならデコーダのバッファをクリアするために、ov_clear() を呼ばなければならない。そしてファイルを閉じる。

(Note that ov_test() provides a less expensive way to test a file for Vorbisness.)
ov_test() が少ないコストでVorbisであるかファイルをテストする方法を提供することを覚えておくべき。




int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes);

Parameters

f
File pointer to an already opened file or pipe (it need not be seekable--though this obviously restricts what can be done with the bitstream).
あらかじめ開かれたファイルかパイプのファイルポインタ。 (移動可能である必要は無い―― たとえそれがビットストリームで可能なことを制限するとしても)
vf
A pointer to the OggVorbis_File structure--this is used for ALL the externally visible libvorbisfile functions. Once this has been called, the same OggVorbis_File struct should be passed to all the libvorbisfile functions.
OggVorbis_File構造体へのポインタ。 これはすべての対外的に可視であるlibvorbisfileの関数で使用される。 一度この関数が呼ばれると同じ OggVorbis_File構造体が すべてのlibvorbisfileの関数に渡されなければならない。
initial
Typically set to NULL. This parameter is useful if some data has already been read from the file and the stream is not seekable. It is used in conjunction with ibytes. In this case, initial should be a pointer to a buffer containing the data read.
通常はNULLをセットする。このパラメータは移動不可能なデータストリームやファイルから、 すでにいくらかデータを読み込んでしまっている場合に便利である。ibytesバイト分結合して使われる。この場合、initial は読まれたデータがあるバッファへのポインタにする必要がある。
ibytes
Typically set to 0. This parameter is useful if some data has already been read from the file and the stream is not seekable. In this case, ibytes should contain the length (in bytes) of the buffer. Used together with initial
通常は0をセットする。このパラメータは移動不可能なデータストリームやファイルから、 すでにいくらかデータを読み込んでしまっている場合に便利である。この場合、 ibytes はバッファの長さをバイト単位で指定する。initialと共に使われる。

Return Values

  • 0 indicates success 0は成功を示す
  • less than zero for failure: 0は未満の時は失敗である
  • Notes

    If your decoder is threaded, it is recommended that you NOT call ov_open() in the main control thread--instead, call ov_open() IN your decode/playback thread. This is important because ov_open() may be a fairly time-consuming call, given that the full structure of the file is determined at this point, which may require reading large parts of the file under certain circumstances (determining all the logical bitstreams in one physical bitstream, for example). See Thread Safety for other information on using libvorbisfile with threads.
    あなたのデコーダーがスレッド化されているなら、ov_open()をメインの制御スレッドで代わりに呼ぶことは推奨されない。 ov_open()はあなたのデコード/プレイバックスレッドで呼ぶべきである。 ある状況下でファイルの構造すべてをセットするために、多めにファイルを読み込む必要があることがあり、 ov_open()は時間が掛かる。(たとえば、1つの物理ビットストリーム内すべての論理ビットストリームを判断するため) libvorbisをスレッドで使うためのほかの情報はスレッドの安全性を見よ。


    copyright © 2002 Xiph.org

    Ogg Vorbis

    Vorbisfile documentation

    libVorbisfile version 1.65 - 20020702