@@ -27,6 +27,10 @@ | |||
#ifndef Audio_h_ | |||
#define Audio_h_ | |||
#if TEENSYDUINO < 120 | |||
#error "Teensyduino version 1.20 or later is required to compile the Audio library" | |||
#endif | |||
// When changing multiple audio object settings that must update at | |||
// the same time, these functions allow the audio library interrupt | |||
// to be disabled. For example, you may wish to begin playing a note |
@@ -6,6 +6,7 @@ | |||
#include <Audio.h> | |||
#include <Wire.h> | |||
#include <SPI.h> | |||
#include <SD.h> | |||
// Create the Audio components. These should be created in the |
@@ -1,5 +1,6 @@ | |||
#include <Audio.h> | |||
#include <Wire.h> | |||
#include <SPI.h> | |||
#include <SD.h> | |||
// Create the Audio components. These should be created in the | |||
@@ -44,7 +45,7 @@ void setup() { | |||
// Enable the audio shield and set the output volume. | |||
audioShield.enable(); | |||
audioShield.volume(0.82); | |||
audioShield.volume(0.75); | |||
while (!Serial) ; | |||
delay(100); |
@@ -1,5 +1,6 @@ | |||
#include <Audio.h> | |||
#include <Wire.h> | |||
#include <SPI.h> | |||
#include <SD.h> | |||
const int myInput = AUDIO_INPUT_LINEIN; |
@@ -8,6 +8,7 @@ This example code is in the public domain | |||
#include <Audio.h> | |||
#include <Wire.h> | |||
#include <SPI.h> | |||
#include <SD.h> | |||
const int myInput = AUDIO_INPUT_LINEIN; |
@@ -1,5 +1,6 @@ | |||
#include <Audio.h> | |||
#include <Wire.h> | |||
#include <SPI.h> | |||
#include <SD.h> | |||
#include <LiquidCrystal.h> | |||
@@ -5,6 +5,7 @@ This example code is in the public domain | |||
#include <Audio.h> | |||
#include <Wire.h> | |||
#include <SPI.h> | |||
#include <SD.h> | |||
const int myInput = AUDIO_INPUT_LINEIN; |
@@ -5,6 +5,7 @@ This example code is in the public domain | |||
#include <Audio.h> | |||
#include <Wire.h> | |||
#include <SPI.h> | |||
#include <SD.h> | |||
const int myInput = AUDIO_INPUT_LINEIN; |
@@ -33,10 +33,8 @@ many blocks you provided with AudioMemory(). | |||
*/ | |||
#include <arm_math.h> | |||
#include <Audio.h> | |||
#include <Wire.h> | |||
//#include <WM8731.h> | |||
#include <SD.h> | |||
#include <SPI.h> | |||
#include <Bounce.h> | |||
@@ -96,7 +94,7 @@ void setup() { | |||
audioShield.enable(); | |||
audioShield.inputSelect(myInput); | |||
audioShield.volume(0.5); | |||
audioShield.volume(0.65); | |||
// Warn that the passthru pin is grounded | |||
if(!digitalRead(PASSTHRU_PIN)) { |
@@ -1,5 +1,6 @@ | |||
#include <Audio.h> | |||
#include <Wire.h> | |||
#include <SPI.h> | |||
#include <SD.h> | |||
const int myInput = AUDIO_INPUT_LINEIN; |
@@ -33,10 +33,8 @@ many blocks you provided with AudioMemory(). | |||
*/ | |||
#include <arm_math.h> | |||
#include <Audio.h> | |||
#include <Wire.h> | |||
//#include <WM8731.h> | |||
#include <SD.h> | |||
#include <SPI.h> | |||
#include <Bounce.h> | |||
@@ -157,7 +155,7 @@ void setup() { | |||
audioShield.enable(); | |||
audioShield.inputSelect(myInput); | |||
audioShield.volume(0.5); | |||
audioShield.volume(0.65); | |||
// Warn that the passthru pin is grounded | |||
if(!digitalRead(PASSTHRU_PIN)) { |
@@ -1,5 +1,6 @@ | |||
#include <Audio.h> | |||
#include <Wire.h> | |||
#include <SPI.h> | |||
#include <SD.h> | |||
const int myInput = AUDIO_INPUT_LINEIN; |
@@ -1,5 +1,6 @@ | |||
#include <Audio.h> | |||
#include <Wire.h> | |||
#include <SPI.h> | |||
#include <SD.h> | |||
@@ -1,6 +1,7 @@ | |||
#include <Audio.h> | |||
#include <Bounce.h> | |||
#include <Wire.h> | |||
#include <SPI.h> | |||
#include <SD.h> | |||
const int myInput = AUDIO_INPUT_LINEIN; |
@@ -1,5 +1,6 @@ | |||
#include <Audio.h> | |||
#include <Wire.h> | |||
#include <SPI.h> | |||
#include <SD.h> | |||
AudioSynthWaveform mysine(AudioWaveformSine); | |||
@@ -23,7 +24,7 @@ void setup() { | |||
mysine.frequency(440); | |||
mysine.amplitude(0.9); | |||
codec.volume(70); | |||
codec.volume(0.70); | |||
Serial.println("setup done"); | |||
} |
@@ -22,12 +22,10 @@ The audio board uses the following pins. | |||
*/ | |||
#include <arm_math.h> | |||
#include <Audio.h> | |||
#include <Wire.h> | |||
//#include <WM8731.h> | |||
#include <SD.h> | |||
#include <SPI.h> | |||
#include <SD.h> | |||
#include <Bounce.h> | |||
AudioSynthToneSweep myEffect; |
@@ -1,43 +0,0 @@ | |||
#include <Audio.h> | |||
#include <Wire.h> | |||
#include <SD.h> | |||
#include <SPI.h> | |||
// Create the Audio components. These should be created in the | |||
// order data flows, inputs/sources -> processing -> outputs | |||
// | |||
AudioPlaySdWav wav; | |||
AudioOutputI2S dac; | |||
// Create Audio connections between the components | |||
// | |||
AudioConnection c1(wav, 0, dac, 0); | |||
AudioConnection c2(wav, 1, dac, 1); | |||
// Create an object to control the audio shield. | |||
// | |||
AudioControlSGTL5000 audioShield; | |||
void setup() { | |||
// Audio connections require memory to work. For more | |||
// detailed information, see the MemoryAndCpuUsage example | |||
AudioMemory(5); | |||
audioShield.enable(); | |||
audioShield.volume(0.5); | |||
SPI.setMOSI(7); | |||
SPI.setSCK(14); | |||
if (SD.begin(10)) { | |||
wav.play("01_16M.WAV"); | |||
} | |||
} | |||
void loop() { | |||
float vol = analogRead(15); | |||
vol = vol / 1024; | |||
audioShield.volume(vol); | |||
delay(20); | |||
} | |||
@@ -1,5 +1,6 @@ | |||
#include <Audio.h> | |||
#include <Wire.h> | |||
#include <SPI.h> | |||
#include <SD.h> | |||
#include <Bounce.h> | |||