DTMF decoder library

The tone length is very strict. If the tone is too short it wont work

How short a tone are you trying? The dialabc example uses 50ms tones. The example code uses a sample length of 128 which means that a sample block is 14 milliseconds long. It should have 3 good blocks in one 50ms tone and might detect tones down to around 30ms - I haven't tried that. You could try making the sample length shorter (try 64) so that the algorithm samples the tone more times. If you do that, you'll have to reduce the threshold amplitude as well.

and if it plays too long it will put print the number multiple times.

When the code detects a tone it won't return it again until it sees something that is not a tone. If for any reason the amplitude drops a bit to just below the threshold it can think it has seen the end of the tone when there's actually still more to come. Try lowering the threshold amplitude just a bit.

Is their any chance you could make it modifiable?

Make what modifiable?

Also, the goertzel algorithm is supposed to compensate for magnitude on its own.

I saw one implementation which divided the resulting magnitude by the number of samples. I don't know if that's actually part of the Goertzel algorithm itself.
I'll play with it in the next day or so.

Again, great job and thanks for your help!

You're welcome :wink:

Pete