From 27d491fcbd1257a6e20174a7e81808be49f71296 Mon Sep 17 00:00:00 2001 From: Takekatsu Hiramura Date: Tue, 2 Jul 2024 22:58:23 +0900 Subject: [PATCH] Add sendInterval to dtmf (#443) Co-authored-by: Takekatsu Hiramura --- lib/src/rtc_session.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/src/rtc_session.dart b/lib/src/rtc_session.dart index 37ee0622..7cabda23 100644 --- a/lib/src/rtc_session.dart +++ b/lib/src/rtc_session.dart @@ -862,6 +862,7 @@ class RTCSession extends EventManager implements Owner { int duration = options['duration'] ?? RTCSession_DTMF.C.DEFAULT_DURATION; int interToneGap = options['interToneGap'] ?? RTCSession_DTMF.C.DEFAULT_INTER_TONE_GAP; + int sendInterval = options['sendInterval'] ?? duration + interToneGap; if (tones == null) { throw Exceptions.TypeError('Not enough arguments'); @@ -945,7 +946,7 @@ class RTCSession extends EventManager implements Owner { dtmf.send(tone, options); await Future.delayed( - Duration(milliseconds: duration + interToneGap), () {}); + Duration(milliseconds: sendInterval), () {}); }); } }