Why cant i play this file on the Teensy audio card

Status
Not open for further replies.

toreil

Member
Hi.
Compiled some wav files with Natural Reader, but cant plsy then.
The example files SDTEST1.. works fine

Tried a lot of Wav settings but NO Go..

Had to rename sample1.wav to .txt to upload.


Tore
 

Attachments

  • sample1.txt
    109.7 KB · Views: 121
I'm listening to it play here on a Teensy 3.1 with audio board. It's saying "Hi, this" over and over again.

Here's the code I'm running. Maybe copy this into Arduino and run it on your board?

Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

AudioPlaySdWav           playWav1;
AudioOutputI2S           audioOutput;
AudioConnection          patchCord1(playWav1, 0, audioOutput, 0);
AudioConnection          patchCord2(playWav1, 1, audioOutput, 1);
AudioControlSGTL5000     sgtl5000_1;

// Use these with the audio adaptor board
#define SDCARD_CS_PIN    10
#define SDCARD_MOSI_PIN  7
#define SDCARD_SCK_PIN   14

void setup() {
  Serial.begin(9600);
  AudioMemory(8);
  sgtl5000_1.enable();
  sgtl5000_1.volume(0.5);
  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);
    }
  }
}

void loop() {
  playWav1.play("SAMPLE1.WAV");
  delay(2500);
}

In your code, check the filename. The Arduino SD lib only knows 8.3 names, which are all uppercase. If you used lowercase letters in your code, it won't be able to find the file.
 
Hi.
Thanks for grate support.
But my original code looked ok, but it seems to be a problem with BIG and smal letters in the filename, and code

Dont know if thst makes any scence,, but its working now...

Thanks


Tore
 
Status
Not open for further replies.
Back
Top