Index: roarclients/Makefile
===================================================================
--- roarclients/Makefile	(revision 5516)
+++ roarclients/Makefile	(revision 5546)
@@ -3,7 +3,7 @@
 TARGETS_IO=roarcat roarcatplay roarcatvio roarbidir roarmon roarmonhttp roarradio
 TARGETS_CTL=roarctl roarlight roarinterconnect roarclientpass
-TARGETS_DSP=roarfilt roarvumeter
+TARGETS_DSP=roarfilt roarvumeter roardtmf
 TARGETS_MISC=roarsockconnect roarphone roarshout
-TARGETS_M=roardtmf
+TARGETS_M=
 TARGETS_VIO=roarvio
 TARGETS_PLUGINS=roarpluginrunner roarpluginapplication
@@ -78,5 +78,5 @@
 	${CC} ${LDFLAGS} -o roarvumeter roarvumeter.o $(LIBS) $(LIBROARDSP) $(lib_m)
 roardtmf: roardtmf.o
-	${CC} ${LDFLAGS} -o roardtmf roardtmf.o $(LIBS) $(lib_m)
+	${CC} ${LDFLAGS} -o roardtmf roardtmf.o $(LIBS) $(LIBROARDSP)
 roarsockconnect: roarsockconnect.o
 	$L
Index: roarclients/roardtmf.c
===================================================================
--- roarclients/roardtmf.c	(revision 5545)
+++ roarclients/roardtmf.c	(revision 5546)
@@ -25,4 +25,5 @@
 
 #include <roaraudio.h>
+#include <libroardsp/libroardsp.h>
 
 #ifdef ROAR_HAVE_LIBM
@@ -30,35 +31,12 @@
 
 // in ms:
+#if 0
 #define ON_TIME  (180)
 #define OFF_TIME ( 80)
+#else
+#define ON_TIME  (180)
+#define OFF_TIME ( 80)
+#endif
 #define SUM_TIME (ON_TIME+OFF_TIME)
-
-struct tone {
- char c;
- float f0;
- float f1;
-} g_tones[] = {
- {'1', 697, 1209},
- {'2', 697, 1336},
- {'3', 697, 1477},
- {'A', 697, 1633},
-
- {'4', 770, 1209},
- {'5', 770, 1336},
- {'6', 770, 1477},
- {'B', 770, 1633},
-
- {'7', 852, 1209},
- {'8', 852, 1336},
- {'9', 852, 1477},
- {'C', 852, 1633},
-
- {'*', 941, 1209},
- {'0', 941, 1336},
- {'#', 941, 1477},
- {'D', 941, 1633},
-
- {0, -1, -1}
-};
 
 void usage (void) {
@@ -74,55 +52,4 @@
 }
 
-int calc_break (int16_t * samples, size_t len, int rate, char c) {
- (void)rate, (void)c;
-// printf("calc_break(*): len=%zu\n", len);
- memset(samples, 0, len);
- return 0;
-}
-
-int calc_tone (int16_t * samples, size_t len, int rate, char c) {
- struct tone * ct = NULL;
- int i;
- float t;
- float t_inc = 1./rate;
- float t_max = ON_TIME / 1000.;
- float fc0, fc1;
-
-// printf("calc_tone(*): len=%zu\n", len);
-
-// printf("calc(*): t_inc=%f, t_max=%f\n", t_inc, t_max);
-
- if ( c >= 'a' )
-  c -= 'a' - 'A';
-
- for (i = 0; g_tones[i].c != 0; i++) {
-  if ( g_tones[i].c == c ) {
-   ct = &(g_tones[i]);
-   break;
-  }
- }
-
-// printf("calc(*): ct=%p\n", ct);
-
- if ( ct == NULL )
-  return -1;
-
- fc0 = 2 * M_PI * ct->f0;
- fc1 = 2 * M_PI * ct->f1;
-
-// printf("fc0=%f, fc1=%f\n", fc0, fc1);
-
- memset(samples, 0, len);
-
- for (i = 0, t = 0; t < t_max; t += t_inc, i++) {
-//  printf("i=%i, t=%f\n", i, t);
-  samples[i] = (sinf(fc0*t) + sinf(fc1*t))*8192.0;
- }
-
-// printf("i=%i\n", i);
-
- return 0;
-}
-
 int main (int argc, char * argv[]) {
  int    rate     = ROAR_RATE_DEFAULT;
@@ -134,4 +61,6 @@
  const char * tones = NULL;
  void * buf;
+ size_t len_break;
+ size_t len_tone;
  size_t samples;
  size_t len;
@@ -162,8 +91,10 @@
  }
 
- samples = SUM_TIME * rate / 1000;
+ len_break = roar_dtmf_mus2samples(OFF_TIME * 1000, rate);
+ len_tone  = roar_dtmf_mus2samples(ON_TIME  * 1000, rate);
+ samples = len_break + len_tone;
 
+ printf("samples=%llu\n", (long long unsigned int)samples);
 /*
- printf("samples=%llu\n", (long long unsigned int)samples);
  return 0;
 */
@@ -185,11 +116,12 @@
 
   if ( c == ' ' ) {
-   calc_break(buf, len, rate, c);
+   roar_dtmf_break(buf, len_tone, rate, ROAR_DTMF_OPTIONS_NONE);
   } else {
-   if ( calc_tone(buf, len, rate, c) == -1 ) {
+   if ( roar_dtmf_tone(buf, len_tone, rate, ROAR_DTMF_OPTIONS_NONE, c) == -1 ) {
     roar_mm_free(buf);
     return 5;
    }
   }
+  roar_dtmf_break(buf+len_tone*sizeof(int16_t), len_break, rate, ROAR_DTMF_OPTIONS_NONE);
   if ( roar_vs_write(vss, buf, len, &err) != (ssize_t)len ) {
    fprintf(stderr, "Error: can not write data: %s\n", roar_vs_strerr(err));
