Extra "ports" of juce-based plugins using the distrho build system
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

390 lines
12KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  5. <head>
  6. <title>protoplug: Class juce.AudioFormatReader</title>
  7. <link rel="stylesheet" href="../ldoc.css" type="text/css" />
  8. </head>
  9. <body>
  10. <div id="container">
  11. <div id="product">
  12. <div id="product_logo"></div>
  13. <div id="product_name"><big><b></b></big></div>
  14. <div id="product_description"></div>
  15. </div> <!-- id="product" -->
  16. <div id="main">
  17. <!-- Menu -->
  18. <div id="navigation">
  19. <a href="http://osar.fr">
  20. <div class=osarlogo> </div>
  21. </a>
  22. <br/>
  23. <a href="http://osar.fr/protoplug">
  24. <h1>protoplug</h1>
  25. </a>
  26. <span class="proto_subtitle">Lua API reference</span>
  27. <ul>
  28. <li><a href="../index.html">Index</a></li>
  29. </ul>
  30. <h2>Contents</h2>
  31. <ul>
  32. <li><a href="#Constructors">Constructors</a></li>
  33. <li><a href="#Methods">Methods</a></li>
  34. <li><a href="#Fields">Fields</a></li>
  35. </ul>
  36. <h2>Classes</h2>
  37. <ul class="$(kind=='Topics' and '' or 'nowrap'">
  38. <li><a href="../classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
  39. <li><strong>juce.AudioFormatReader</strong></li>
  40. <li><a href="../classes/juce.Colour.html">juce.Colour</a></li>
  41. <li><a href="../classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
  42. <li><a href="../classes/juce.Component.html">juce.Component</a></li>
  43. <li><a href="../classes/juce.FillType.html">juce.FillType</a></li>
  44. <li><a href="../classes/juce.Font.html">juce.Font</a></li>
  45. <li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
  46. <li><a href="../classes/juce.Image.html">juce.Image</a></li>
  47. <li><a href="../classes/juce.Justification.html">juce.Justification</a></li>
  48. <li><a href="../classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
  49. <li><a href="../classes/juce.Line.html">juce.Line</a></li>
  50. <li><a href="../classes/juce.Path.html">juce.Path</a></li>
  51. <li><a href="../classes/juce.Point.html">juce.Point</a></li>
  52. <li><a href="../classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
  53. <li><a href="../classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
  54. <li><a href="../classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
  55. </ul>
  56. <h2>Modules</h2>
  57. <ul class="$(kind=='Topics' and '' or 'nowrap'">
  58. <li><a href="../modules/plugin.html">plugin</a></li>
  59. <li><a href="../modules/script.html">script</a></li>
  60. <li><a href="../modules/midi.html">midi</a></li>
  61. <li><a href="../modules/gui.html">gui</a></li>
  62. <li><a href="../modules/polyGen.html">polyGen</a></li>
  63. <li><a href="../modules/stereoFx.html">stereoFx</a></li>
  64. </ul>
  65. <h2>Examples</h2>
  66. <ul class="$(kind=='Topics' and '' or 'nowrap'">
  67. <li><a href="../examples/classic-filter.lua.html">classic-filter.lua</a></li>
  68. <li><a href="../examples/sine-organ.lua.html">sine-organ.lua</a></li>
  69. <li><a href="../examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
  70. <li><a href="../examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
  71. <li><a href="../examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
  72. </ul>
  73. </div>
  74. <div id="content">
  75. <h1>Class <code>juce.AudioFormatReader</code></h1>
  76. <p>Class to read audio files.</p>
  77. <p> Example usage: <a href="../examples/soundfile-test.lua.html#">soundfile-test.lua</a>.</p>
  78. <p> Reads the formats that JUCE supports, namely: WAV, AIFF, Flac, Ogg-Vorbis, Windows Media codecs,
  79. CoreAudio codecs, MP3. </p>
  80. <p> Is a pointer to a <a href="http://www.juce.com/api/classAudioFormatReader.html">JUCE AudioFormatReader</a>,
  81. and wraps some <a href="http://www.juce.com/api/classAudioFormatManager.html">AudioFormatManager</a>
  82. functionality. </p>
  83. <h2><a href="#Constructors">Constructors</a></h2>
  84. <table class="function_list">
  85. <tr>
  86. <td class="name" nowrap><a href="#juce.AudioFormatReader.AudioFormatReader"><span class="proto_prefix">juce</span>.AudioFormatReader (filename)</a></td>
  87. <td class="summary">Load a sound file as an AudioFormatReader.</td>
  88. </tr>
  89. </table>
  90. <h2><a href="#Methods">Methods</a></h2>
  91. <table class="function_list">
  92. <tr>
  93. <td class="name" nowrap><a href="#juce.AudioFormatReader:read"><span class="wrapman"><span class="proto_prefix">juce.AudioFormatReader</span>:read<br> (destSamples, numDestChannels, startSampleInSource, numSamplesToRead[, fillLeftoverChannelsWithCopies=true])</span></a></td>
  94. <td class="summary">Read samples.</td>
  95. </tr>
  96. <tr>
  97. <td class="name" nowrap><a href="#juce.AudioFormatReader:readToFloat"><span class="proto_prefix">juce.AudioFormatReader</span>:readToFloat<br> ([nChannels=2[, resample=true]])</a></td>
  98. <td class="summary">Read entire wave to float array.</td>
  99. </tr>
  100. <tr>
  101. <td class="name" nowrap><a href="#juce.AudioFormatReader:readToDouble"><span class="proto_prefix">juce.AudioFormatReader</span>:readToDouble<br> ([nChannels=2[, resample=true]])</a></td>
  102. <td class="summary">Read entire wave to double array.</td>
  103. </tr>
  104. </table>
  105. <h2><a href="#Fields">Fields</a></h2>
  106. <table class="function_list">
  107. <tr>
  108. <td class="name" nowrap><a href="#juce.AudioFormatReader.sampleRate"><span class="proto_prefix">juce.AudioFormatReader</span>.sampleRate</a></td>
  109. <td class="summary">Sample rate</td>
  110. </tr>
  111. <tr>
  112. <td class="name" nowrap><a href="#juce.AudioFormatReader.bitsPerSample"><span class="proto_prefix">juce.AudioFormatReader</span>.bitsPerSample</a></td>
  113. <td class="summary">Bits per sample</td>
  114. </tr>
  115. <tr>
  116. <td class="name" nowrap><a href="#juce.AudioFormatReader.lengthInSamples"><span class="proto_prefix">juce.AudioFormatReader</span>.lengthInSamples</a></td>
  117. <td class="summary">Length in samples</td>
  118. </tr>
  119. <tr>
  120. <td class="name" nowrap><a href="#juce.AudioFormatReader.numChannels"><span class="proto_prefix">juce.AudioFormatReader</span>.numChannels</a></td>
  121. <td class="summary">Number of channels</td>
  122. </tr>
  123. <tr>
  124. <td class="name" nowrap><a href="#juce.AudioFormatReader.usesFloatingPointData"><span class="proto_prefix">juce.AudioFormatReader</span>.usesFloatingPointData</a></td>
  125. <td class="summary">Uses floating point data (boolean)</td>
  126. </tr>
  127. </table>
  128. <br/>
  129. <br/>
  130. <h2><a name="Constructors"></a>Constructors</h2>
  131. <dl class="function">
  132. <dt>
  133. <a name = "juce.AudioFormatReader.AudioFormatReader"></a>
  134. <strong><span class="proto_prefix">juce</span>.AudioFormatReader (filename)</strong>
  135. </dt>
  136. <dd>
  137. Load a sound file as an AudioFormatReader.
  138. The path can be absolute or relative to the protoplug directory.
  139. Returns <code>nil</code> if unsuccessful. The file will remain open until the
  140. AudioFormatReader is unset or otherwise garbage-collected.
  141. </ul>
  142. <h3>Parameters:</h3>
  143. <ul>
  144. <li><span class="parameter">filename</span>
  145. </li>
  146. </ul>
  147. </dd>
  148. </dl>
  149. <h2><a name="Methods"></a>Methods</h2>
  150. <dl class="function">
  151. <dt>
  152. <a name = "juce.AudioFormatReader:read"></a>
  153. <strong><span class="wrapman"><span class="proto_prefix">juce.AudioFormatReader</span>:read<br> (destSamples, numDestChannels, startSampleInSource, numSamplesToRead[, fillLeftoverChannelsWithCopies=true])</span></strong>
  154. </dt>
  155. <dd>
  156. Read samples. <br/>
  157. Copies a number of samples from the file into the provided array.
  158. </ul>
  159. <h3>Parameters:</h3>
  160. <ul>
  161. <li><span class="parameter">destSamples</span>
  162. a cdata array of pointers to buffers for each channel (<code>int * const *</code>)
  163. </li>
  164. <li><span class="parameter">numDestChannels</span>
  165. the number of elements in <code>destSamples</code>
  166. </li>
  167. <li><span class="parameter">startSampleInSource</span>
  168. </li>
  169. <li><span class="parameter">numSamplesToRead</span>
  170. </li>
  171. <li><span class="parameter">fillLeftoverChannelsWithCopies</span>
  172. <span class="types"><span class="type">boolean</span></span>
  173. used if <code>destSamples</code> has more channels than the source.
  174. (<em>default</em> true)
  175. </li>
  176. </ul>
  177. <h3>Returns:</h3>
  178. <ol>
  179. <span class="types"><span class="type">boolean</span></span>
  180. success
  181. </ol>
  182. </dd>
  183. <dt>
  184. <a name = "juce.AudioFormatReader:readToFloat"></a>
  185. <strong><span class="proto_prefix">juce.AudioFormatReader</span>:readToFloat<br> ([nChannels=2[, resample=true]])</strong>
  186. </dt>
  187. <dd>
  188. Read entire wave to float array. <br/>
  189. A simplified wrapper function for <a href="../classes/juce.AudioFormatReader.html#juce.AudioFormatReader:read">read</a>
  190. </ul>
  191. <h3>Parameters:</h3>
  192. <ul>
  193. <li><span class="parameter">nChannels</span>
  194. number of channels to be returned
  195. (<em>default</em> 2)
  196. </li>
  197. <li><span class="parameter">resample</span>
  198. whether to perform samplerate conversion to match the host's sample rate.
  199. If <code>true</code>, the length of the returned array may not be the wave's original <a href="../classes/juce.AudioFormatReader.html#juce.AudioFormatReader.lengthInSamples">lengthInSamples</a> .
  200. It will be given by the second returned value.
  201. (<em>default</em> true)
  202. </li>
  203. </ul>
  204. <h3>Returns:</h3>
  205. <ol>
  206. <li>
  207. a two-dimensional cdata array of channels containing samples (<code>float [nChannels][nSamples]</code>)</li>
  208. <li>
  209. the number of samples in each channel of the returned array</li>
  210. </ol>
  211. </dd>
  212. <dt>
  213. <a name = "juce.AudioFormatReader:readToDouble"></a>
  214. <strong><span class="proto_prefix">juce.AudioFormatReader</span>:readToDouble<br> ([nChannels=2[, resample=true]])</strong>
  215. </dt>
  216. <dd>
  217. Read entire wave to double array. <br/>
  218. This wraps <a href="../classes/juce.AudioFormatReader.html#juce.AudioFormatReader:readToFloat">readToFloat</a> and returns an array containing <code>double</code>-precision numbers.
  219. This takes twice as much space, but it may be faster to use, as this is the native Lua type.
  220. </ul>
  221. <h3>Parameters:</h3>
  222. <ul>
  223. <li><span class="parameter">nChannels</span>
  224. number of channels to be returned
  225. (<em>default</em> 2)
  226. </li>
  227. <li><span class="parameter">resample</span>
  228. whether to perform samplerate conversion to match the host's sample rate.
  229. If <code>true</code>, the length of the returned array may not be the wave's original <a href="../classes/juce.AudioFormatReader.html#juce.AudioFormatReader.lengthInSamples">lengthInSamples</a> .
  230. It will be given by the second returned value.
  231. (<em>default</em> true)
  232. </li>
  233. </ul>
  234. <h3>Returns:</h3>
  235. <ol>
  236. <li>
  237. a two-dimensional cdata array of channels containing samples (<code>double [nChannels][nSamples]</code>)</li>
  238. <li>
  239. the number of samples in each channel of the returned array</li>
  240. </ol>
  241. </dd>
  242. </dl>
  243. <h2><a name="Fields"></a>Fields</h2>
  244. <dl class="function">
  245. <dt>
  246. <a name = "juce.AudioFormatReader.sampleRate"></a>
  247. <strong><span class="proto_prefix">juce.AudioFormatReader</span>.sampleRate</strong>
  248. </dt>
  249. <dd>
  250. Sample rate
  251. </ul>
  252. </dd>
  253. <dt>
  254. <a name = "juce.AudioFormatReader.bitsPerSample"></a>
  255. <strong><span class="proto_prefix">juce.AudioFormatReader</span>.bitsPerSample</strong>
  256. </dt>
  257. <dd>
  258. Bits per sample
  259. </ul>
  260. </dd>
  261. <dt>
  262. <a name = "juce.AudioFormatReader.lengthInSamples"></a>
  263. <strong><span class="proto_prefix">juce.AudioFormatReader</span>.lengthInSamples</strong>
  264. </dt>
  265. <dd>
  266. Length in samples
  267. </ul>
  268. </dd>
  269. <dt>
  270. <a name = "juce.AudioFormatReader.numChannels"></a>
  271. <strong><span class="proto_prefix">juce.AudioFormatReader</span>.numChannels</strong>
  272. </dt>
  273. <dd>
  274. Number of channels
  275. </ul>
  276. </dd>
  277. <dt>
  278. <a name = "juce.AudioFormatReader.usesFloatingPointData"></a>
  279. <strong><span class="proto_prefix">juce.AudioFormatReader</span>.usesFloatingPointData</strong>
  280. </dt>
  281. <dd>
  282. Uses floating point data (boolean)
  283. </ul>
  284. </dd>
  285. </dl>
  286. </div> <!-- id="content" -->
  287. </div> <!-- id="main" -->
  288. <div id="about">
  289. <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
  290. </div> <!-- id="about" -->
  291. </div> <!-- id="container" -->
  292. </body>
  293. </html>