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.

46 line
1.9KB

  1. <h3>Summary</h3>
  2. <p>Play a RAW data file, stored on a SD card. RAW format is simpler
  3. than WAV and begins playing immediately, without parsing WAV file
  4. header info.</p>
  5. <h3>Audio Connections</h3>
  6. <table class=doc align=center cellpadding=3>
  7. <tr class=top><th>Port</th><th>Purpose</th></tr>
  8. <tr class=odd><td align=center>Out 0</td><td>Sound Output</td></tr>
  9. </table>
  10. <h3>Functions</h3>
  11. <p class=func><span class=keyword>play</span>(filename);</p>
  12. <p class=desc>Begin playing a RAW data file. If a file is already playing,
  13. it is stopped and this file starts playing from the beginning.
  14. </p>
  15. <p class=func><span class=keyword>stop</span>();</p>
  16. <p class=desc>Stop playing. If not playing, this function has no effect.
  17. </p>
  18. <p class=func><span class=keyword>isPlaying</span>();</p>
  19. <p class=desc>Return true (non-zero) if playing, or false (zero)
  20. when not playing.
  21. </p>
  22. <p class=func><span class=keyword>positionMillis</span>();</p>
  23. <p class=desc>While playing, return the current time offset, in
  24. milliseconds. When not playing, the return from this function
  25. is undefined.
  26. </p>
  27. <p class=func><span class=keyword>lengthMillis</span>();</p>
  28. <p class=desc>Return the total length of the current sound clip,
  29. in milliseconds. When not playing, the return from this function
  30. is undefined.
  31. </p>
  32. <h3>Examples</h3>
  33. <p class=exam>File &gt; Examples &gt; Audio &gt; Recorder
  34. </p>
  35. <h3>Notes</h3>
  36. <p>The data file must be RAW 16 bit signed integers in LSB-first format.
  37. </p>
  38. <p>While playing, the audio library accesses the SD card automatically.
  39. If card access is required, you must
  40. <a href="http://www.pjrc.com/teensy/td_libs_AudioProcessorUsage.html" target="_blank">AudioNoInterrupts()</a>
  41. to prevent the library from accessing the SD card while you use it.
  42. Disabling the audio library interrupt for too long may cause audible
  43. dropouts or glitches.
  44. </p>