going-digital / Talkie

Speech library for Arduino
314 stars 112 forks source link

x variables are not initialised per execution of say #38

Open kevinjwalters opened 4 years ago

kevinjwalters commented 4 years ago

The x "array" of variables which represent some intermedate values inside the filter are only initialised once when the program runs due to C/C++ rules for static variables. The code can be seen on https://github.com/going-digital/Talkie/blob/7f57628bcfa78cad346508d0d43541cce50da1b3/Talkie/talkie.cpp#L152

Should those be zero'd everytime at the start of say function? At the moment a second invocation of say is very likely to generate slightly different output for the same input data, albeit only briefly at the start.

Also, x10 is never used in the program.

I've not executed this code, I've just inspected it...