DTMF: Now allows to give duration and pause for digit
Also the dtmf encoder will return less samples, if the digit(+pause) ends, so that the caller call set the next digit to play seamlessly. A reset function allows to clear the decoder states, to prevent glitches when re-attaching to an interrupted stream.
This commit is contained in:
@@ -96,7 +96,7 @@ int main(void)
|
||||
for (i = 0; i < 16; i++) {
|
||||
printf("Testing digit '%c' encoding and decoding:\n", test_digits[i]);
|
||||
memset(samples, 0, sizeof(samples[0]) * SAMPLERATE);
|
||||
dtmf_encode_set_tone(&dtmf_enc, test_digits[i]);
|
||||
dtmf_encode_set_tone(&dtmf_enc, test_digits[i], 1.0, 0.0);
|
||||
dtmf_encode(&dtmf_enc, samples + SAMPLERATE / 10, SAMPLERATE / 20);
|
||||
got_digit = 0;
|
||||
dtmf_decode(&dtmf_dec, samples, SAMPLERATE);
|
||||
|
Reference in New Issue
Block a user