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.

53 lines
2.2KB

  1. <h3>Summary</h3>
  2. <div>
  3. <p>Play a RAW data file, stored on a Serial Flash chip. These chips
  4. are far more efficient than SD cards, allowing many files to be
  5. played simultaneously by copies of this object.
  6. </p>
  7. <p align=center><img src="img/w25q128fv.jpg"><br><small>W25Q128FV Serial Flash</small></p>
  8. </div>
  9. <h3>Audio Connections</h3>
  10. <table class=doc align=center cellpadding=3>
  11. <tr class=top><th>Port</th><th>Purpose</th></tr>
  12. <tr class=odd><td align=center>Out 0</td><td>Sound Output</td></tr>
  13. </table>
  14. <h3>Functions</h3>
  15. <p class=func><span class=keyword>play</span>(filename);</p>
  16. <p class=desc>Begin playing a RAW data file. If a file is already playing,
  17. it is stopped and this file starts playing from the beginning.
  18. </p>
  19. <p class=func><span class=keyword>stop</span>();</p>
  20. <p class=desc>Stop playing. If not playing, this function has no effect.
  21. </p>
  22. <p class=func><span class=keyword>isPlaying</span>();</p>
  23. <p class=desc>Return true (non-zero) if playing, or false (zero)
  24. when not playing.
  25. </p>
  26. <p class=func><span class=keyword>positionMillis</span>();</p>
  27. <p class=desc>While playing, return the current time offset, in
  28. milliseconds. When not playing, the return from this function
  29. is undefined.
  30. </p>
  31. <p class=func><span class=keyword>lengthMillis</span>();</p>
  32. <p class=desc>Return the total length of the current sound clip,
  33. in milliseconds. When not playing, the return from this function
  34. is undefined.
  35. </p>
  36. <h3>Examples</h3>
  37. <!--<p class=exam>File &gt; Examples &gt; Audio &gt; Recorder-->
  38. <p class=exam>TODO: play example needed....
  39. </p>
  40. <p class=exam>File &gt; Examples &gt; SerialFlash &gt; CopyFromSD
  41. </p>
  42. <h3>Notes</h3>
  43. <p>The data file must be RAW 16 bit signed integers in LSB-first format.
  44. </p>
  45. <p>The <a href="https://github.com/PaulStoffregen/SerialFlash" target="_blank">SerialFlash library</a>
  46. is used to access the flash chip. You can also use SerialFlash's functions
  47. to access the stored files, or add data to the flash chip.
  48. </p>
  49. <p>File names are case sensitive with SerialFlash. If your sound does
  50. not play, use <b>File &gt; Examples &gt; SerialFlash &gt; ListFiles</b> to
  51. check the exact file names stored in the flash memory chip.