Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

49 lines
1.9KB

  1. <h3>Summary</h3>
  2. <p>Record audio data by sending to the Arduino sketch. This object allows
  3. sketch code to receive audio packets.</p>
  4. <h3>Audio Connections</h3>
  5. <table class=doc align=center cellpadding=3>
  6. <tr class=top><th>Port</th><th>Purpose</th></tr>
  7. <tr class=odd><td align=center>In 0</td><td>Sound To Access</td></tr>
  8. </table>
  9. <h3>Functions</h3>
  10. <p class=func><span class=keyword>begin</span>();</p>
  11. <p class=desc>Begin capturing incoming audio to the queue. After calling
  12. begin, readBuffer() and freeBuffer(), or clear() must be used frequently
  13. to prevent the queue from filling up.
  14. </p>
  15. <p class=func><span class=keyword>available</span>();</p>
  16. <p class=desc>Returns the number of audio packets available to read.
  17. </p>
  18. <p class=func><span class=keyword>readBuffer</span>();</p>
  19. <p class=desc>Read a single audio packet. A pointer to a 128 sample
  20. array of 16 bit integers is returned. NULL is returned if no packets
  21. are available.
  22. </p>
  23. <p class=func><span class=keyword>freeBuffer</span>();</p>
  24. <p class=desc>Release the memory from the previously read packet returned
  25. from readBuffer(). Only a single packet at a time may be read, and
  26. each packet must be freed with this function, to return the memory to
  27. the audio library.
  28. </p>
  29. <p class=func><span class=keyword>clear</span>();</p>
  30. <p class=desc>Discard all audio held in the queue.
  31. </p>
  32. <p class=func><span class=keyword>end</span>();</p>
  33. <p class=desc>Stop capturing incoming audio into the queue. Data already
  34. captured remains in the queue and may be read with readBuffer().
  35. </p>
  36. <h3>Examples</h3>
  37. <p class=exam>File &gt; Examples &gt; Audio &gt; Recorder
  38. </p>
  39. <h3>Notes</h3>
  40. <p>
  41. Up to 52 packets may be queued by this object, which allows approximately
  42. 150 ms of audio to be held in the queue, to allow time for the Arduino
  43. sketch to write data to media or do other high-latency tasks.
  44. The actual packets are taken
  45. from the pool created by AudioMemory().
  46. </p>