Hi,
I get a high screeching sound when using an UNO with the Talkie library with a PAM8403 amplifier and the following schematic and code from the Talkie examples. I have connected the UNO power to a power supply. I can hear the words at low volume without distortion, but at higher volume the screeching sound appears.
Can someone please help me get rid of the high screeching sound? I have tried to add resistor or capacitator between the PAM8403 and the UNO but to no avail. Do I need both resistors (which Ohm) AND a capacitator (which uF) and how to wire?
// Talkie library
// Copyright 2011 Peter Knight
// This code is released under GPLv2 license.
//
// Welcome to the Talkie library examples.
//
// Talkie is a speech synthesiser that works from a fixed vocabulary.
//
// There are hundreds of words in the 'Vocabulary' examples.
//
/*
 * Voice PWM output pins for different ATmegas:
 *  ATmega328 (Uno and Nano): non inverted at pin 3, inverted at pin 11.
 *  ATmega2560: non inverted at pin 6, inverted at pin 7.
 *  ATmega32U4 (Leonardo): non inverted at pin 10, inverted at pin 9.
 *  ATmega32U4 (CircuitPlaygound): only non inverted at pin 5.
 *
 *  As default both inverted and not inverted outputs are enabled to increase volume if speaker is attached between them.
 *  Use Talkie Voice(true, false); if you only need not inverted pin or if you want to use SPI on ATmega328 which needs pin 11.
 *
 *  The outputs can drive headphones directly, or add a simple audio amplifier to drive a loudspeaker.
 */
#include <Arduino.h>
#include "Talkie.h"
#include "Vocab_US_Large.h"
Talkie voice;
void setup() {
  voice.doNotUseInvertedOutput();
  voice.say(sp2_DANGER);
  voice.say(sp2_DANGER);
  voice.say(sp2_RED);
  voice.say(sp2_ALERT);
  voice.say(sp2_MOTOR);
  voice.say(sp2_IS);
  voice.say(sp2_ON);
  voice.say(sp2_FIRE);
}
void loop() {
}


