選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

54 行
2.3KB

  1. <h3>Summary</h3>
  2. <p>Play a WAV file, stored on a SD card.</p>
  3. <h3>Audio Connections</h3>
  4. <table class=doc align=center cellpadding=3>
  5. <tr class=top><th>Port</th><th>Purpose</th></tr>
  6. <tr class=odd><td align=center>Out 0</td><td>Left Channel Output</td></tr>
  7. <tr class=odd><td align=center>Out 1</td><td>Right Channel Output</td></tr>
  8. </table>
  9. <h3>Functions</h3>
  10. <p class=func><span class=keyword>play</span>(filename);</p>
  11. <p class=desc>Begin playing a WAV file. If a file is already playing,
  12. it is stopped and this file starts playing from the beginning.
  13. </p>
  14. <p class=func><span class=keyword>stop</span>();</p>
  15. <p class=desc>Stop playing. If not playing, this function has no effect.
  16. </p>
  17. <p class=func><span class=keyword>isPlaying</span>();</p>
  18. <p class=desc>Return true (non-zero) if playing, or false (zero)
  19. when not playing. See the note below about delayed start.
  20. </p>
  21. <p class=func><span class=keyword>positionMillis</span>();</p>
  22. <p class=desc>While playing, return the current time offset, in
  23. milliseconds. When not playing, the return from this function
  24. is undefined.
  25. </p>
  26. <p class=func><span class=keyword>lengthMillis</span>();</p>
  27. <p class=desc>Return the total length of the current sound clip,
  28. in milliseconds. When not playing, the return from this function
  29. is undefined.
  30. </p>
  31. <h3>Examples</h3>
  32. <p class=exam>File &gt; Examples &gt; Audio &gt; WavFilePlayer
  33. </p>
  34. <h3>Notes</h3>
  35. <p>Only 16 bit PCM, 44100 Hz WAV files are supported. When mono
  36. files are played, both output ports transmit a copy of the
  37. single sound. Of course, stereo WAV files play with the left
  38. channel on port 0 and the right channel on port 1.
  39. </p>
  40. <p>A brief delay after calling play() will usually occur before
  41. isPlaying() returns true and positionMillis() returns valid
  42. time offset. WAV files have a header at the beginning of the
  43. file, which the audio library must read and parse before
  44. playing can begin.
  45. </p>
  46. <p>While playing, the audio library accesses the SD card automatically.
  47. If card access is required, you must
  48. <a href="http://www.pjrc.com/teensy/td_libs_AudioProcessorUsage.html" target="_blank">use AudioNoInterrupts()</a>
  49. to prevent the library from accessing the SD card while you use it.
  50. Disabling the audio library interrupt for too long may cause audible
  51. dropouts or glitches.
  52. </p>