decoding.html 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <html>
  2. <head>
  3. <title>Tremor - 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>Tremor documentation</p></td>
  10. <td align=right><p class=tiny>Tremor version 1.0 - 20020403</p></td>
  11. </tr>
  12. </table>
  13. <h1>Decoding</h1>
  14. <p>
  15. All libivorbisdec decoding routines are declared in "ivorbisfile.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>. This
  19. function works similarly to reading from a normal file using
  20. <tt>read()</tt>.<p>
  21. However, a few differences are worth noting:
  22. <h2>multiple stream links</h2>
  23. A Vorbis stream may consist of multiple sections (called links) that
  24. encode differing numbers of channels or sample rates. It is vitally
  25. important to pay attention to the link numbers returned by <a
  26. href="ov_read.html">ov_read</a> and handle audio changes that may
  27. occur at link boundaries. Such multi-section files do exist in the
  28. wild and are not merely a specification curiosity.
  29. <h2>returned data amount</h2>
  30. <a href="ov_read.html">ov_read</a> does not attempt to completely fill
  31. a large, passed in data buffer; it merely guarantees that the passed
  32. back data does not overflow the passed in buffer size. Large buffers
  33. may be filled by iteratively looping over calls to <a
  34. href="ov_read.html">ov_read</a> (incrementing the buffer pointer)
  35. until the original buffer is filled.
  36. <h2>file cursor position</h2>
  37. Vorbis files do not necessarily start at a sample number or time offset
  38. of zero. Do not be surprised if a file begins at a positive offset of
  39. several minutes or hours, such as would happen if a large stream (such
  40. as a concert recording) is chopped into multiple seperate files.
  41. <p>
  42. <table border=1 color=black width=50% cellspacing=0 cellpadding=7>
  43. <tr bgcolor=#cccccc>
  44. <td><b>function</b></td>
  45. <td><b>purpose</b></td>
  46. </tr>
  47. <tr valign=top>
  48. <td><a href="ov_read.html">ov_read</a></td>
  49. <td>This function makes up the main chunk of a decode loop. It takes an
  50. OggVorbis_File structure, which must have been initialized by a previous
  51. call to <a href="ov_open.html"><tt>ov_open()</tt></a>.</td>
  52. </tr>
  53. </table>
  54. <br><br>
  55. <hr noshade>
  56. <table border=0 width=100%>
  57. <tr valign=top>
  58. <td><p class=tiny>copyright &copy; 2002 Xiph.org</p></td>
  59. <td align=right><p class=tiny><a href="http://www.xiph.org/ogg/vorbis/">Ogg Vorbis</a></p></td>
  60. </tr><tr>
  61. <td><p class=tiny>Tremor documentation</p></td>
  62. <td align=right><p class=tiny>Tremor version 1.0 - 20020403</p></td>
  63. </tr>
  64. </table>
  65. </body>
  66. </html>