Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

43 lines
1.8KB

  1. <h3>Summary</h3>
  2. <p>Play a short sound clip, stored directly in memory.
  3. Data files are created with the
  4. <a href="https://github.com/PaulStoffregen/Audio/tree/master/examples/SamplePlayer/wav2sketch" target="_blank">wav2sketch program</a>,
  5. and copied to the sketch folder to become part of your sketch.</p>
  6. <h3>Audio Connections</h3>
  7. <table class=doc align=center cellpadding=3>
  8. <tr class=top><th>Port</th><th>Purpose</th></tr>
  9. <tr class=odd><td align=center>Out 0</td><td>Sound Output</td></tr>
  10. </table>
  11. <h3>Functions</h3>
  12. <p class=func><span class=keyword>play</span>(data);</p>
  13. <p class=desc>Begin playing a sound clip. If already playing, the
  14. currently playing clip is stopped and this new data begins
  15. playing from the beginning.
  16. </p>
  17. <p class=func><span class=keyword>stop</span>();</p>
  18. <p class=desc>Stop playing. If not playing, this function has no effect.
  19. </p>
  20. <p class=func><span class=keyword>isPlaying</span>();</p>
  21. <p class=desc>Return true (non-zero) if playing, or false (zero)
  22. when not playing.
  23. </p>
  24. <p class=func><span class=keyword>positionMillis</span>();</p>
  25. <p class=desc>While playing, return the current time offset, in
  26. milliseconds. When not playing, the return from this function
  27. is undefined.
  28. </p>
  29. <p class=func><span class=keyword>lengthMillis</span>();</p>
  30. <p class=desc>Return the total length of the current sound clip,
  31. in milliseconds. When not playing, the return from this function
  32. is undefined.
  33. </p>
  34. <h3>Examples</h3>
  35. <p class=exam>File &gt; Examples &gt; Audio &gt; SamplePlayer
  36. </p>
  37. <h3>Notes</h3>
  38. <p>TODO: supported sample rates: 11.025, 22.05, 44.1</p>
  39. <p>TODO: ulaw vs uncompressed encoding</p>
  40. <p>Polyphonic playback can be built by creating multiple
  41. objects, with their output combined by mixers.</p>