Prop Shield and Tennsy 3.2 : no sound at all...

Status
Not open for further replies.

laufla

New member
Hi all,
first, excuse my poor english...

I'm playing with teensy for a while and have done things the audio shield and leds.

I get the Prop Shield to build a buzz wire game : some leds to count hits, a motor to give a feedback on contacts, and sounds to give more fun

i've a 4homs 10w speaker from an old car directly connected to the prop shield.

I can't get sounds from the card :

transfering raw file is ok
i changed sketch to use DAC
i can hear a small "noise" at startup and nothing else.

I used WavFilePlay to test it, but still no sound :(

so, here's my bottle to the sea...

Thank's for all,
Laurent
 
Have you enabled the output ?

Code:
   [COLOR=#000000]dac1[/COLOR][COLOR=#434f54].[/COLOR][COLOR=#d35400]analogReference[/COLOR][COLOR=#000000]([/COLOR][COLOR=#00979c]EXTERNAL[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000];[/COLOR] [COLOR=#434f54]// much louder![/COLOR]
  [COLOR=#d35400]delay[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]50[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000];[/COLOR]             [COLOR=#434f54]// time for DAC voltage stable[/COLOR]
  [COLOR=#d35400]pinMode[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]5[/COLOR][COLOR=#434f54],[/COLOR] [COLOR=#00979c]OUTPUT[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000];[/COLOR]
  [COLOR=#d35400]digitalWrite[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]5[/COLOR][COLOR=#434f54],[/COLOR] [COLOR=#00979c]HIGH[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000];[/COLOR] [COLOR=#434f54]// turn on the amplifier[/COLOR]
  [COLOR=#d35400]delay[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]10[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000];[/COLOR]             [COLOR=#434f54]// allow time to wake up
[/COLOR]
 
Thank's for your help Frank,
I added your code to the one i'm using. still no sound.

here's the code i'm using :


Code :
// Converted from the WavFilePlay from the Teensy release:
// hardware/teensy/avr/libraries/Audio/examples/WavFilePlayer/WavFilePlayer.ino
//
// Simple RAW file player example for the prop shield to use the Analog DAC
// and prop shield amplifier to play mono sounds.
// http://www.pjrc.com/teensy/gui/?info=AudioOutputAnalog
//
// On the prop shield, pin 6 selects the serial flash memory controller,
// and pin 5 enables the amplifier.
//
// This example code is in the public domain.

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

// GUItool: begin automatically generated code
AudioPlaySerialflashRaw playFlashRaw1; //xy=149,388
AudioMixer4 mixer1; //xy=445,386
AudioOutputAnalog dac1; //xy=591,379
AudioConnection patchCord1(playFlashRaw1, 0, mixer1, 0);
AudioConnection patchCord2(mixer1, dac1);
// GUItool: end automatically generated code

void setup() {
Serial.begin(9600);

// wait up to 3 seconds for the Serial device to become available
long unsigned debug_start = millis ();
while (!Serial && ((millis () - debug_start) <= 3000))
;

Serial.println ("Start prop shield RAW player");

// Enable the amplifier on the prop shield


dac1.analogReference(EXTERNAL); // much louder!
delay(50); // time for DAC voltage stable
Serial.println ("===> DAC1 Enabled");
pinMode(5, OUTPUT);
Serial.println ("PIN 5 SET AS OUTPUT");
digitalWrite(5, HIGH); // turn on the amplifier
delay(10); // allow time to wake up
Serial.println ("PIN 5 SET HIGH");

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

// Set initial volume
mixer1.gain(0, 0.5f);

// uncomment these lines if you have a potentiometer or trimpot
// on the pin A1 to control the volume, and comment out the
// above line
// float vol = analogRead(VOLUME_POT);
// mixer1.gain(0, vol / 1024.0f);

// Start SerialFlash
if (!SerialFlash.begin(6)) {
while (1)
{
Serial.println ("Cannot access SPI Flash chip");
delay (1000);
}
}
}

void playFile(const char *filename)
{
Serial.print("Playing file: ");
Serial.println(filename);

// Start playing the file. This sketch continues to
// run while the file plays.
playFlashRaw1.play(filename);

// A brief delay for the library read RAW info
delay(5);

// Simply wait for the file to finish playing.
while (playFlashRaw1.isPlaying()) {
// uncomment these lines if you have a potentiometer or trimpot
// on the pin A1 to control the volume
// float vol = analogRead(VOLUME_POT);
// mixer1.gain(0, 1024 / 1024.0f);
}
}


void loop() {
playFile("BREAK.RAW"); // filenames are always uppercase 8.3 format
delay(500);
playFile("CLICK.RAW");
delay(1500);
}
 
Your sketch works on my T3.2 and propshield (with my .RAW file) and 8ohm speaker. Do you have T3.2 DAC/A14 connected to propshield DAC/AudioIN?
 
Last edited:
Sometimes I like to eliminate hardware issues versus the software issues.

So have you tried running something else that uses the DAC.
What I often try is the library Talkie and try one of the examples like: Vocab_US_large
 
Status
Not open for further replies.
Back
Top