Reensy Raw player with buttons: No sound - no errors

Status
Not open for further replies.

dywen

Member
Hi,
I have adapted one of the example sketches of the Teensy internal memory raw player to a sound player of raw files on the memory card of the audio board.

Unfortunately I have no sound - but also no errors..
Can someone give me a hand at debugging?
I converted the mono wave files to raw with audacity (also with sox - but no difference there)
Thanks!
Dywen

Here's my code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
#include <Bounce.h>


// Create the Audio components. These should be created in the
// order data flows, inputs/sources -> processing -> outputs
//
AudioPlaySdRaw sound0; //xy=319,114
AudioPlaySdRaw sound1; //xy=320,160
AudioPlaySdRaw sound2; //xy=324,211
AudioPlaySdRaw sound3; //xy=331,255
AudioPlaySdRaw sound4; //xy=333,300
AudioPlaySdRaw sound5; //xy=341,350
AudioMixer4 mix1; // two 4-channel mixers are needed in
AudioMixer4 mix2; // tandem to combine 6 audio sources
AudioOutputI2S headphones; //xy=909,159
AudioOutputAnalog dac; // play to both I2S audio board and on-chip DAC
// Create Audio connections between the components
//
AudioConnection patchCord1(sound0, 0, mix1, 0);
AudioConnection patchCord2(sound1, 0, mix1, 1);
AudioConnection patchCord3(sound2, 0, mix1, 2);
AudioConnection patchCord4(sound3, 0, mix1, 3);
AudioConnection patchCord5(sound4, 0, mix2, 1);
AudioConnection patchCord6(sound5, 0, mix2, 2);
AudioConnection patchCord7(mix1, 0, mix2, 0); // output of mix1 into 1st input on mix2
AudioConnection patchCord8(mix2, 0, headphones, 0);
AudioConnection patchCord9(mix2, 0, headphones, 1);
AudioConnection patchCord10(mix2, dac);


// Create an object to control the audio shield.
//
AudioControlSGTL5000 audioShield; //xy=341,471

// Bounce objects to read six pushbuttons (pins 0-5)
//
Bounce button0 = Bounce(0, 5);
Bounce button1 = Bounce(1, 5); // 5 ms debounce time
Bounce button2 = Bounce(2, 5);
Bounce button3 = Bounce(3, 5);
Bounce button4 = Bounce(4, 5);
Bounce button5 = Bounce(5, 5);


void setup() {
// Configure the pushbutton pins for pullups.
// Each button should connect from the pin to GND.
pinMode(0, INPUT_PULLUP);
pinMode(1, INPUT_PULLUP);
pinMode(2, INPUT_PULLUP);
pinMode(3, INPUT_PULLUP);
pinMode(4, INPUT_PULLUP);
pinMode(5, INPUT_PULLUP);

// Audio connections require memory to work. For more
// detailed information, see the MemoryAndCpuUsage example
AudioMemory(10);

// turn on the output
audioShield.enable();
audioShield.volume(0.5);

// by default the Teensy 3.1 DAC uses 3.3Vp-p output
// if your 3.3V power has noise, switching to the
// internal 1.2V reference can give you a clean signal
//dac.analogReference(INTERNAL);

// reduce the gain on mixer channels, so more than 1
// sound can play simultaneously without clipping
mix1.gain(0, 0.4);
mix1.gain(1, 0.4);
mix1.gain(2, 0.4);
mix1.gain(3, 0.4);
mix2.gain(1, 0.4);
mix2.gain(2, 0.4);
}

void loop() {
// Update all the button objects
button0.update();
button1.update();
button2.update();
button3.update();
button4.update();
button5.update();

// When the buttons are pressed, just start a sound playing.
// The audio library will play each sound through the mixers
// so any combination can play simultaneously.
//
if (button0.fallingEdge()) {
sound0.play("zero.raw");
}
if (button1.fallingEdge()) {
sound1.play("one.raw");
}
if (button2.fallingEdge()) {
sound2.play("two.raw");
}
if (button3.fallingEdge()) {
sound3.play("three.raw");
}
if (button4.fallingEdge()) {
sound4.play("four.raw");
}
if (button5.fallingEdge()) {
sound5.play("five.raw");
}

}



Here are my raw files (encrypted - takes a while to download):
Each link is another file
https://framadrop.org/r/5xR8W1IaFl#4Fc9cD9pG1/WQVPUwSBbE+q2+X6XQoD+o0cQzT86UJU=
https://framadrop.org/r/EKG4aEZ8wE#Um3d9bftjrFhOcuRXFAFbHsURkvdvdVbesYVPRW7SkA=
https://framadrop.org/r/ph6bfL4Zby#fZl9dlRVG07BJssPKEKWD5PGZM/TtKxi/ImYSMm3TCM=
https://framadrop.org/r/EromaXSUZI#0xiZ59+naGPmV+m/IGE8G884vNAopCECTBR2iZ0rVIA=
https://framadrop.org/r/b_xPbuf0iG#jLZBK1iBcDCM+IwR8l6F1CVQ4J3AosDKv1eFf63MmAw=
https://framadrop.org/r/QJLTxSVvol#VmyFU+Y2mQxRsz5YJqv/9Y+aK4OvUMGkqfTtmo4J8ig=
https://framadrop.org/r/8hv3v5VRUj#KASTPWM3bfL9hrSgiTW3g4yDp3skpCVEHM016M1Zohs=
 
Reensy = Teensy
Arghhh public typo's..

--> extra information
- Teensy 3.2
- the buttons, sd card worked perfectly with another sketch (to make the microphone records raw files)

thanks!

w
 
Status
Not open for further replies.
Back
Top