Giter Club home page Giter Club logo

Comments (14)

PaintYourDragon avatar PaintYourDragon commented on August 10, 2024 1

Should be fixed now in version 1.8.2 of the library. Found some unrelated problems in the playTone() function while I was in there, this should take care of that as well.

from adafruit_circuitplayground.

ladyada avatar ladyada commented on August 10, 2024

hmm can you try the Talkie library direct? you'll need to install it and run the demos but it ought to work?
https://github.com/adafruit/Talkie

from adafruit_circuitplayground.

manitou48 avatar manitou48 commented on August 10, 2024

On playground classic (AVR mega32u4), circuit playground speech examples are just noise with Arduino 1.8.4 and 1.8.5, with the latest github version 1.8. I reverted to Arduino 1.8.1 and examples worked.

from adafruit_circuitplayground.

maxicusj avatar maxicusj commented on August 10, 2024

Thank you, guys! with the Arduino version 1.8.0 all working fine. Talkie too.

from adafruit_circuitplayground.

manitou48 avatar manitou48 commented on August 10, 2024

I thought the problem was with the compilers for Arduino IDE 1.8.4 and 1.8.5, but further testing shows that Arduino 1.8.4 speech examples work if I use version 1.6.4 of CircuitPlayground library. The speech is noise with library version 1.6.8 and 1.8.0. Arduino 1.8.4 ships with lib 1.6.8. Arduino 1.8.1 ships with lib 1.6.4

from adafruit_circuitplayground.

maxicusj avatar maxicusj commented on August 10, 2024

strange, I got Arduino 1.8.1 and CircuitPlayground library 1.8.0 and that seems to work OK. Development platform is OSX.

from adafruit_circuitplayground.

manitou48 avatar manitou48 commented on August 10, 2024

Nope, not for me with Ubuntu. I had to remove the arduino 1.8.1 version of circuitplayground library for sketch to use my sketchbook/llibrary version (1.8.0). speech examples are noise with arduino 1.8.1 and lib 1.8.0. (are you sure IDE is using lib 1.8.0 and not builtin 1.6.4?)

from adafruit_circuitplayground.

maxicusj avatar maxicusj commented on August 10, 2024

no, not sure. But 1.8.0 is what I see in the Library Manager as being installed. How else can one check?

from adafruit_circuitplayground.

manitou48 avatar manitou48 commented on August 10, 2024

you'll need to remove/mv the IDE version of the CircuitPlayground library (and restart IDE). you might look around to see if other copies are lurking.

from adafruit_circuitplayground.

maxicusj avatar maxicusj commented on August 10, 2024

ok, I think I will leave it the way it is. Don't touch the running system :-) thanks for tips and solving this.

from adafruit_circuitplayground.

manitou48 avatar manitou48 commented on August 10, 2024

ladyada, I think the problem with broken speech examples in 1.8.0 lib is in utility/Adafruit_CPlay_Speaker.cpp in the begin() method. lib 1.6.4
has

void Adafruit_CPlay_Speaker::begin(void) {
  // Set up Timer4 for fast PWM on !OC4A
  PLLFRQ  = (PLLFRQ & 0xCF) | 0x30;   // Route PLL to async clk
  TCCR4A  = _BV(COM4A0) | _BV(PWM4A); // Clear on match, PWMA on
  TCCR4B  = _BV(PWM4X)  |_BV(CS40);   // PWM invert, 1:1 prescale
  TCCR4D  = 0;                        // Fast PWM mode
  TCCR4E  = 0;                        // Not enhanced mode
  TC4H    = 0;                        // Not 10-bit mode
  DT4     = 0;                        // No dead time
  OCR4C   = 255;                      // TOP
  OCR4A   = 127;                      // 50% duty (idle position) to start
  started = true;
  pinMode(5, OUTPUT);                // Enable output
}

but lib 1.8.0 only has pinMode(). Adding the additional code to 1.8.0 begin allowed speech examples to work.

from adafruit_circuitplayground.

ladyada avatar ladyada commented on August 10, 2024

could be!! @PaintYourDragon wanna take a look?

from adafruit_circuitplayground.

manitou48 avatar manitou48 commented on August 10, 2024

It may take a little more work and regression testing, because i noticed that the beep/tones of demo example no longer work with Speaker::begin() mods above. All work with lib 1.6.4

Actually, the snippet of code above does appear in lib 1.8.0 in playSound() in Adafruit_CPlay_Speaker.cpp, conditional on started ....

from adafruit_circuitplayground.

manitou48 avatar manitou48 commented on August 10, 2024

Latest attempt at patching lib 1.8.0. Rather than pasting PLLFRQ stuff in CPlay_Speaker::begin(), I added it into say() in talkie.cpp as below

if(!started) {
    begin();
#ifdef __AVR__
  // Set up Timer4 for fast PWM on !OC4A
  PLLFRQ  = (PLLFRQ & 0xCF) | 0x30;   // Route PLL to async clk
  TCCR4A  = _BV(COM4A0) | _BV(PWM4A); // Clear on match, PWMA on
  TCCR4B  = _BV(PWM4X)  |_BV(CS40);   // PWM invert, 1:1 prescale
  TCCR4D  = 0;                        // Fast PWM mode
  TCCR4E  = 0;                        // Not enhanced mode
  TC4H    = 0;                        // Not 10-bit mode
  DT4     = 0;                        // No dead time
  OCR4C   = 255;                      // TOP
  OCR4A   = 127;                      // 50% duty (idle position) to start
  started = true;
#endif
  }

speech examples play and tone/beep still works in demo

from adafruit_circuitplayground.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.