<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <link rel="stylesheet" href="style.css" type="text/css"> <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"> <link rel="Start" href="index.html"> <link rel="Up" href="Vorbis.File.html"> <link title="Index of types" rel=Appendix href="index_types.html"> <link title="Index of exceptions" rel=Appendix href="index_exceptions.html"> <link title="Index of values" rel=Appendix href="index_values.html"> <link title="Index of modules" rel=Appendix href="index_modules.html"> <link title="Vorbis" rel="Chapter" href="Vorbis.html"><title>Vorbis.File.Decoder</title> </head> <body> <div class="navbar"> <a href="Vorbis.File.html">Up</a> </div> <center><h1>Module <a href="type_Vorbis.File.Decoder.html">Vorbis.File.Decoder</a></h1></center> <br> <pre><span class="keyword">module</span> Decoder: <code class="code">sig</code> <a href="Vorbis.File.Decoder.html">..</a> <code class="code">end</code></pre><hr width="100%"> <pre><span class="keyword">type</span> <a name="TYPEt"></a><code class="type"></code>t </pre> <div class="info"> Internal state of a decoder.<br> </div> <pre><span class="keyword">val</span> <a name="VALcreate"></a>create : <code class="type">(int -> string * int) -><br> (int -> Unix.seek_command -> int) -><br> (unit -> unit) -> (unit -> int) -> <a href="Vorbis.File.Decoder.html#TYPEt">t</a></code></pre><div class="info"> <code class="code">create read_func seek_func close_func tell_func params</code> opens a stream like <code class="code">openfile</code> for decoding but callbacks are used to manipulate the data. <code class="code">read_func</code> should return the requested amount of bytes (or less if it is the end of file), <code class="code">seek_funk</code> should return 0 if the seek was ok or -1 if the stream is not seekable, <code class="code">close_func</code> should close the stream, and <code class="code">tell_func</code> should return the current offset or -1 if there is no notion of offset in the stream. Raises: <code class="code">Read_error</code>, <code class="code">Not_vorbis</code>, <code class="code">Version_mismatch</code>, <code class="code">Bad_header</code>, <code class="code">Internal_fault</code>.<br> </div> <pre><span class="keyword">val</span> <a name="VALopenfile"></a>openfile : <code class="type">string -> <a href="Vorbis.File.Decoder.html#TYPEt">t</a></code></pre><div class="info"> Open a vorbis file for decoding.<br> </div> <pre><span class="keyword">val</span> <a name="VALopenfile_with_fd"></a>openfile_with_fd : <code class="type">string -> <a href="Vorbis.File.Decoder.html#TYPEt">t</a> * Unix.file_descr</code></pre><pre><span class="keyword">val</span> <a name="VALdecode_float"></a>decode_float : <code class="type"><a href="Vorbis.File.Decoder.html#TYPEt">t</a> -> float array array -> int -> int -> int</code></pre><div class="info"> <code class="code">decode_float dec buff ofs len</code> decodes <code class="code">len</code> samples in each channel and puts the result in <code class="code">buff</code> starting at position <code class="code">ofs</code>. <br> <b>Raises</b><ul><li><code>Hole_in_data</code> if there was an interruption of the data.</li> <li><code>Invalid_parameters</code> if all the data cannot fit in the buffer starting at the given position.</li> </ul> </div> <pre><span class="keyword">val</span> <a name="VALdecode_float_alloc"></a>decode_float_alloc : <code class="type"><a href="Vorbis.File.Decoder.html#TYPEt">t</a> -> int -> float array array</code></pre><pre><span class="keyword">val</span> <a name="VALdecode"></a>decode : <code class="type"><a href="Vorbis.File.Decoder.html#TYPEt">t</a> -><br> ?big_endian:bool -><br> ?sample_size:int -> ?signed:bool -> string -> int -> int -> int</code></pre><div class="info"> Same as <code class="code">decode_float</code> but decodes to integers.<br> </div> <pre><span class="keyword">val</span> <a name="VALclose"></a>close : <code class="type"><a href="Vorbis.File.Decoder.html#TYPEt">t</a> -> unit</code></pre><div class="info"> Close a decoder. Every decoder must be closed after use and must not be used after it is closed.<br> </div> <pre><span class="keyword">val</span> <a name="VALstreams"></a>streams : <code class="type"><a href="Vorbis.File.Decoder.html#TYPEt">t</a> -> int</code></pre><div class="info"> Get the number of logical bitstreams within a physical bitstream.<br> </div> <pre><span class="keyword">val</span> <a name="VALbitstream"></a>bitstream : <code class="type"><a href="Vorbis.File.Decoder.html#TYPEt">t</a> -> <a href="Vorbis.html#TYPEbitstream">Vorbis.bitstream</a></code></pre><div class="info"> Get the index of the sequential logical bitstream currently being decoded (incremented at chaining boundaries even for non-seekable streams). For seekable streams, it represents the actual chaining index within the physical bitstream.<br> </div> <pre><span class="keyword">val</span> <a name="VALcomments"></a>comments : <code class="type"><a href="Vorbis.File.Decoder.html#TYPEt">t</a> -> <a href="Vorbis.html#TYPEbitstream">Vorbis.bitstream</a> -> string * (string * string) list</code></pre><div class="info"> Get the vorbis comments from a vorbis file. The second argument is the number of the logical bitstream (the current bitstream is used if it is set to <code class="code">None</code>).<br> </div> <pre><span class="keyword">val</span> <a name="VALinfo"></a>info : <code class="type"><a href="Vorbis.File.Decoder.html#TYPEt">t</a> -> <a href="Vorbis.html#TYPEbitstream">Vorbis.bitstream</a> -> <a href="Vorbis.html#TYPEinfo">Vorbis.info</a></code></pre><div class="info"> Get the vorbis information from the stream header of a bitstream.<br> </div> <pre><span class="keyword">val</span> <a name="VALbitrate"></a>bitrate : <code class="type"><a href="Vorbis.File.Decoder.html#TYPEt">t</a> -> <a href="Vorbis.html#TYPEbitstream">Vorbis.bitstream</a> -> int</code></pre><div class="info"> Get the bitrate of a bitsream (in bps).<br> </div> <pre><span class="keyword">val</span> <a name="VALsamples"></a>samples : <code class="type"><a href="Vorbis.File.Decoder.html#TYPEt">t</a> -> <a href="Vorbis.html#TYPEbitstream">Vorbis.bitstream</a> -> int</code></pre><div class="info"> Get the total pcm samples of a bitstream.<br> </div> <pre><span class="keyword">val</span> <a name="VALduration"></a>duration : <code class="type"><a href="Vorbis.File.Decoder.html#TYPEt">t</a> -> <a href="Vorbis.html#TYPEbitstream">Vorbis.bitstream</a> -> float</code></pre><div class="info"> Get the duration in seconds of a bitstream.<br> </div> <pre><span class="keyword">val</span> <a name="VALserialnumber"></a>serialnumber : <code class="type"><a href="Vorbis.File.Decoder.html#TYPEt">t</a> -> <a href="Vorbis.html#TYPEbitstream">Vorbis.bitstream</a> -> int</code></pre><div class="info"> Get the serial number of a bitstream.<br> </div> </body></html>