decoding.html 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <html>
  2. <head>
  3. <title>Vorbisfile - Decoding</title>
  4. <link rel=stylesheet href="style.css" type="text/css">
  5. </head>
  6. <body bgcolor=white text=black link="#5555ff" alink="#5555ff" vlink="#5555ff">
  7. <table border=0 width=100%>
  8. <tr>
  9. <td><p class=tiny>Vorbisfile documentation</p></td>
  10. <td align=right><p class=tiny>vorbisfile version 1.3.2 - 20101101</p></td>
  11. </tr>
  12. </table>
  13. <h1>Decoding</h1>
  14. <p>
  15. All libvorbisfile decoding routines are declared in "vorbis/vorbisfile.h".
  16. <p>
  17. After <a href="initialization.html">initialization</a>, decoding audio
  18. is as simple as calling <a href="ov_read.html">ov_read()</a> (or the
  19. similar functions <a href="ov_read_float.html">ov_read_float()</a> and
  20. <a href="ov_read_filter.html">ov_read_filter</a>). This function works
  21. similarly to reading from a normal file using <tt>read()</tt>.<p>
  22. However, a few differences are worth noting:
  23. <h2>multiple stream links</h2>
  24. A Vorbis stream may consist of multiple sections (called links) that
  25. encode differing numbers of channels or sample rates. It is vitally
  26. important to pay attention to the link numbers returned by <a
  27. href="ov_read.html">ov_read</a> and handle audio changes that may
  28. occur at link boundaries. Such multi-section files do exist in the
  29. wild and are not merely a specification curiosity.
  30. <h2>returned data amount</h2>
  31. <a href="ov_read.html">ov_read</a> does not attempt to completely fill
  32. a large, passed in data buffer; it merely guarantees that the passed
  33. back data does not overflow the passed in buffer size. Large buffers
  34. may be filled by iteratively looping over calls to <a
  35. href="ov_read.html">ov_read</a> (incrementing the buffer pointer)
  36. until the original buffer is filled.
  37. <h2>file cursor position</h2>
  38. Vorbis files do not necessarily start at a sample number or time offset
  39. of zero. Do not be surprised if a file begins at a positive offset of
  40. several minutes or hours, such as would happen if a large stream (such
  41. as a concert recording) is chopped into multiple seperate files.
  42. <p>
  43. <table border=1 color=black width=50% cellspacing=0 cellpadding=7>
  44. <tr bgcolor=#cccccc>
  45. <td><b>function</b></td>
  46. <td><b>purpose</b></td>
  47. </tr>
  48. <tr valign=top>
  49. <td><a href="ov_read.html">ov_read</a></td>
  50. <td>This function makes up the main chunk of a decode loop. It takes an
  51. OggVorbis_File structure, which must have been initialized by a previous
  52. call to <a href="ov_open.html"><tt>ov_open()</tt></a>, <a href="ov_fopen.html"><tt>ov_fopen()</tt></a>,
  53. or <a href="ov_open_callbacks.html"><tt>ov_open_callbacks()</tt></a>.</td>
  54. </tr>
  55. <tr valign=top>
  56. <td><a href="ov_read_float.html">ov_read_float</a></td>
  57. <td>This function decodes to floats instead of integer samples.</td>
  58. </tr>
  59. <tr valign=top>
  60. <td><a href="ov_read_filter.html">ov_read_filter</a></td>
  61. <td>This function works like <a href="ov_read.html">ov_read</a>, but passes the PCM data through the provided filter before converting to integer sample data.</td>
  62. </tr>
  63. </table>
  64. <br><br>
  65. <hr noshade>
  66. <table border=0 width=100%>
  67. <tr valign=top>
  68. <td><p class=tiny>copyright &copy; 2000-2010 Xiph.Org</p></td>
  69. <td align=right><p class=tiny><a href="http://www.xiph.org/ogg/vorbis/">Ogg Vorbis</a></p></td>
  70. </tr><tr>
  71. <td><p class=tiny>Vorbisfile documentation</p></td>
  72. <td align=right><p class=tiny>vorbisfile version 1.3.2 - 20101101</p></td>
  73. </tr>
  74. </table>
  75. </body>
  76. </html>