Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

114 linhas
4.2KB

  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 "control_sgtl5000.h"
  64. #include "control_wm8731.h"
  65. #include "control_ak4558.h"
  66. #include "control_cs4272.h"
  67. #include "control_cs42448.h"
  68. #include "effect_bitcrusher.h"
  69. #include "effect_chorus.h"
  70. #include "effect_fade.h"
  71. #include "effect_flange.h"
  72. #include "effect_envelope.h"
  73. #include "effect_multiply.h"
  74. #include "effect_delay.h"
  75. #include "effect_delay_ext.h"
  76. #include "effect_midside.h"
  77. #include "effect_reverb.h"
  78. #include "filter_biquad.h"
  79. #include "filter_fir.h"
  80. #include "filter_variable.h"
  81. #include "input_adc.h"
  82. #include "input_adcs.h"
  83. #include "input_i2s.h"
  84. #include "input_i2s_quad.h"
  85. #include "mixer.h"
  86. #include "output_dac.h"
  87. #include "output_dacs.h"
  88. #include "output_i2s.h"
  89. #include "output_i2s_quad.h"
  90. #include "output_pwm.h"
  91. #include "output_spdif.h"
  92. #include "output_pt8211.h"
  93. #include "play_memory.h"
  94. #include "play_queue.h"
  95. #include "play_sd_raw.h"
  96. #include "play_sd_wav.h"
  97. #include "play_serialflash_raw.h"
  98. #include "record_queue.h"
  99. #include "synth_tonesweep.h"
  100. #include "synth_sine.h"
  101. #include "synth_waveform.h"
  102. #include "synth_dc.h"
  103. #include "synth_whitenoise.h"
  104. #include "synth_pinknoise.h"
  105. #include "synth_karplusstrong.h"
  106. #include "synth_simple_drum.h"
  107. #endif