Hello,
i am using Teensy 3.6, Arduino 1.84 and Teensyduino 1.39.
I have 2 short WAV files on an SD card Sandisk Ultra 16GB HC I and try to play these 2 WAV files at the same time.
One WAV file is played through DAC channel 0 and the other through DAC channel 1.
I get some blanks in the output from time to time ( 2-5 times OK, then bad output ).
Here is the Sketch:
i have attached the scope pictures of the DAC output.
The first picture is how it should be. The second and third picture shows the problem.
The Yellow Pulse is about 4ms high and 4 ms low.
Sampling is 44100 Hz, 16 Bit Mono.
https://www.dropbox.com/s/330sdr8mzwea3d4/HolzB.wav?dl=0
https://www.dropbox.com/s/jdb6wsxua9usug5/Pulse1.wav?dl=0
I also tried this with Teensy 3.2 and mixing the 2 WAV files with mixer object. This setup works fine. Same setup with Teensy 3.6 gave the same problems.
What could be the problem ?
i am using Teensy 3.6, Arduino 1.84 and Teensyduino 1.39.
I have 2 short WAV files on an SD card Sandisk Ultra 16GB HC I and try to play these 2 WAV files at the same time.
One WAV file is played through DAC channel 0 and the other through DAC channel 1.
I get some blanks in the output from time to time ( 2-5 times OK, then bad output ).
Here is the Sketch:
Code:
#include <Bounce.h>
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioPlaySdWav playWav1; //xy=547,467
AudioPlaySdWav playWav2; //xy=551,665
AudioOutputAnalogStereo dac; //xy=983,525
AudioConnection patchCord1(playWav1, 0, dac, 0);
AudioConnection patchCord2(playWav2, 0, dac, 1);
// GUItool: end automatically generated code
// Use these with the Teensy 3.5 & 3.6 SD card
#define SDCARD_CS_PIN BUILTIN_SDCARD
#define SDCARD_MOSI_PIN 11 // not actually used
#define SDCARD_SCK_PIN 13 // not actually used
Bounce button0 = Bounce(0,10); // 10 ms debounce time
void setup() {
Serial.begin(9600);
AudioMemory(10);
pinMode(0, INPUT_PULLUP);
SPI.setMOSI(SDCARD_MOSI_PIN);
SPI.setSCK(SDCARD_SCK_PIN);
if (!(SD.begin(SDCARD_CS_PIN))) {
while (1) {
Serial.println("Unable to access the SD card");
delay(500);
}
}
dac.analogReference(INTERNAL);
}
void loop() {
button0.update();
if(button0.fallingEdge()) {
playWav1.play("Pulse1.WAV");
playWav2.play("HolzB.WAV");
}
}
The first picture is how it should be. The second and third picture shows the problem.
The Yellow Pulse is about 4ms high and 4 ms low.
Sampling is 44100 Hz, 16 Bit Mono.
https://www.dropbox.com/s/330sdr8mzwea3d4/HolzB.wav?dl=0
https://www.dropbox.com/s/jdb6wsxua9usug5/Pulse1.wav?dl=0
I also tried this with Teensy 3.2 and mixing the 2 WAV files with mixer object. This setup works fine. Same setup with Teensy 3.6 gave the same problems.
What could be the problem ?
Last edited: