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.

Audio.h 4.9KB

11 vuotta sitten
10 vuotta sitten
10 vuotta sitten
10 vuotta sitten
10 vuotta sitten
10 vuotta sitten
10 vuotta sitten
10 vuotta sitten
10 vuotta sitten
4 vuotta sitten
7 vuotta sitten
6 vuotta sitten
4 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
10 vuotta sitten
10 vuotta sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /* Audio Library for Teensy 3.X
  2. * Copyright (c) 2014, Paul Stoffregen, paul@pjrc.com
  3. *
  4. * Development of this audio library was funded by PJRC.COM, LLC by sales of
  5. * Teensy and Audio Adaptor boards. Please support PJRC's efforts to develop
  6. * open source software by purchasing Teensy or other PJRC products.
  7. *
  8. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9. * of this software and associated documentation files (the "Software"), to deal
  10. * in the Software without restriction, including without limitation the rights
  11. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12. * copies of the Software, and to permit persons to whom the Software is
  13. * furnished to do so, subject to the following conditions:
  14. *
  15. * The above copyright notice, development funding notice, and this permission
  16. * notice shall be included in all copies or substantial portions of the Software.
  17. *
  18. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  23. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  24. * THE SOFTWARE.
  25. */
  26. #ifndef Audio_h_
  27. #define Audio_h_
  28. #if TEENSYDUINO < 120
  29. #error "Teensyduino version 1.20 or later is required to compile the Audio library."
  30. #endif
  31. #ifdef __AVR__
  32. #error "The Audio Library only works with Teensy 3.X. Teensy 2.0 is unsupported."
  33. #endif
  34. #include "DMAChannel.h"
  35. #if !defined(DMACHANNEL_HAS_BEGIN) || !defined(DMACHANNEL_HAS_BOOLEAN_CTOR)
  36. #error "You need to update DMAChannel.h & DMAChannel.cpp"
  37. #error "https://github.com/PaulStoffregen/cores/blob/master/teensy3/DMAChannel.h"
  38. #error "https://github.com/PaulStoffregen/cores/blob/master/teensy3/DMAChannel.cpp"
  39. #endif
  40. // When changing multiple audio object settings that must update at
  41. // the same time, these functions allow the audio library interrupt
  42. // to be disabled. For example, you may wish to begin playing a note
  43. // in response to reading an analog sensor. If you have "velocity"
  44. // information, you might start the sample playing and also adjust
  45. // the gain of a mixer channel. Use AudioNoInterrupts() first, then
  46. // make both changes to the 2 separate objects. Then allow the audio
  47. // library to update with AudioInterrupts(). Both changes will happen
  48. // at the same time, because AudioNoInterrupts() prevents any updates
  49. // while you make changes.
  50. //
  51. #define AudioNoInterrupts() (NVIC_DISABLE_IRQ(IRQ_SOFTWARE))
  52. #define AudioInterrupts() (NVIC_ENABLE_IRQ(IRQ_SOFTWARE))
  53. // include all the library headers, so a sketch can use a single
  54. // #include <Audio.h> to get the whole library
  55. //
  56. #include "analyze_fft256.h"
  57. #include "analyze_fft1024.h"
  58. #include "analyze_print.h"
  59. #include "analyze_tonedetect.h"
  60. #include "analyze_notefreq.h"
  61. #include "analyze_peak.h"
  62. #include "analyze_rms.h"
  63. #include "async_input_spdif3.h"
  64. #include "control_sgtl5000.h"
  65. #include "control_wm8731.h"
  66. #include "control_ak4558.h"
  67. #include "control_cs4272.h"
  68. #include "control_cs42448.h"
  69. #include "control_tlv320aic3206.h"
  70. #include "effect_bitcrusher.h"
  71. #include "effect_chorus.h"
  72. #include "effect_fade.h"
  73. #include "effect_flange.h"
  74. #include "effect_envelope.h"
  75. #include "effect_multiply.h"
  76. #include "effect_delay.h"
  77. #include "effect_delay_ext.h"
  78. #include "effect_midside.h"
  79. #include "effect_reverb.h"
  80. #include "effect_freeverb.h"
  81. #include "effect_waveshaper.h"
  82. #include "effect_granular.h"
  83. #include "effect_combine.h"
  84. #include "effect_rectifier.h"
  85. #include "filter_biquad.h"
  86. #include "filter_fir.h"
  87. #include "filter_variable.h"
  88. #include "input_adc.h"
  89. #include "input_adcs.h"
  90. #include "input_i2s.h"
  91. #include "input_i2s2.h"
  92. #include "input_i2s_quad.h"
  93. #include "input_i2s_hex.h"
  94. #include "input_i2s_oct.h"
  95. #include "input_tdm.h"
  96. #include "input_tdm2.h"
  97. #include "input_pdm.h"
  98. #include "input_spdif3.h"
  99. #include "mixer.h"
  100. #include "output_dac.h"
  101. #include "output_dacs.h"
  102. #include "output_i2s.h"
  103. #include "output_i2s2.h"
  104. #include "output_i2s_quad.h"
  105. #include "output_i2s_hex.h"
  106. #include "output_i2s_oct.h"
  107. #include "output_mqs.h"
  108. #include "output_pwm.h"
  109. #include "output_spdif.h"
  110. #include "output_spdif2.h"
  111. #include "output_spdif3.h"
  112. #include "output_pt8211.h"
  113. #include "output_pt8211_2.h"
  114. #include "output_tdm.h"
  115. #include "output_tdm2.h"
  116. #include "output_adat.h"
  117. #include "play_memory.h"
  118. #include "play_queue.h"
  119. #include "play_sd_raw.h"
  120. #include "play_sd_wav.h"
  121. #include "play_serialflash_raw.h"
  122. #include "record_queue.h"
  123. #include "synth_tonesweep.h"
  124. #include "synth_sine.h"
  125. #include "synth_waveform.h"
  126. #include "synth_dc.h"
  127. #include "synth_whitenoise.h"
  128. #include "synth_pinknoise.h"
  129. #include "synth_karplusstrong.h"
  130. #include "synth_simple_drum.h"
  131. #include "synth_pwm.h"
  132. #include "synth_wavetable.h"
  133. #endif