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 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. // When changing multiple audio object settings that must update at
  32. // the same time, these functions allow the audio library interrupt
  33. // to be disabled. For example, you may wish to begin playing a note
  34. // in response to reading an analog sensor. If you have "velocity"
  35. // information, you might start the sample playing and also adjust
  36. // the gain of a mixer channel. Use AudioNoInterrupts() first, then
  37. // make both changes to the 2 separate objects. Then allow the audio
  38. // library to update with AudioInterrupts(). Both changes will happen
  39. // at the same time, because AudioNoInterrupts() prevents any updates
  40. // while you make changes.
  41. //
  42. #define AudioNoInterrupts() (NVIC_DISABLE_IRQ(IRQ_SOFTWARE))
  43. #define AudioInterrupts() (NVIC_ENABLE_IRQ(IRQ_SOFTWARE))
  44. // include all the library headers, so a sketch can use a single
  45. // #include <Audio.h> to get the whole library
  46. //
  47. #include "analyze_fft256.h"
  48. #include "analyze_fft1024.h"
  49. #include "analyze_print.h"
  50. #include "analyze_tonedetect.h"
  51. #include "analyze_peakdetect.h"
  52. #include "control_sgtl5000.h"
  53. #include "control_wm8731.h"
  54. #include "effect_chorus.h"
  55. #include "effect_fade.h"
  56. #include "effect_flange.h"
  57. #include "effect_envelope.h"
  58. #include "effect_multiply.h"
  59. #include "effect_delay.h"
  60. #include "filter_biquad.h"
  61. #include "filter_fir.h"
  62. #include "filter_variable.h"
  63. #include "input_adc.h"
  64. #include "input_i2s.h"
  65. #include "mixer.h"
  66. #include "output_dac.h"
  67. #include "output_i2s.h"
  68. #include "output_pwm.h"
  69. #include "play_memory.h"
  70. #include "play_queue.h"
  71. #include "play_sd_raw.h"
  72. #include "play_sd_wav.h"
  73. #include "synth_tonesweep.h"
  74. #include "synth_sine.h"
  75. #include "synth_waveform.h"
  76. #include "synth_dc.h"
  77. #include "synth_whitenoise.h"
  78. #include "synth_pinknoise.h"
  79. // TODO: more audio processing objects....
  80. // waveforms with bandwidth limited tables for synth
  81. #endif