[webrtc-pc] DTMF tonechange event timing when toneBuffer is modified in between

soareschen has just created a new issue for https://github.com/w3c/webrtc-pc:

== DTMF tonechange event timing when toneBuffer is modified in between ==
The current spec says:

> 11. If a Playout task is scheduled to be run, abort these steps; otherwise queue a task that runs the following steps (Playout task): 
>> 6. If tone is not "," start playout of tone for duration ms on the associated RTP media stream, using the appropriate codec, then queue a task to be executed in duration + interToneGap ms from now that runs the steps labelled Playout task.

This means that if `toneBuffer` is changed via `insertDTMF()` in the middle of `tonechange` events firing, the first character of the new `toneBuffer` is supposed to fire only after the `duration` + `interToneGap` time of the last `tonechange` event. (1)

For the behavior of `tonechange` when Playout Task is not scheduled, the first character is `toneBuffer` is fired almost immediately after `insertDTMF()`. (2)

On Firefox, I am getting the `tonechange` event fired immediately after `insertDTMF()` even though Playout Task is already running. I'd like to confirm if the first case (1) is the intended behavior when Playout Task is scheduled.

Example code:

```javascript
dtmfSender.insertDTMF('ABC', 100, 70);
dtmfSender.addEventListener('tonechange', ev => {
  if(ev.tone === 'B') {
    // Do tonechange event for '1' is fired almost immediately
    // after this line, or 170ms after?
    dtmfSender.insertDTMF('123', 100, 70);
  }
});
```

Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/1517 using your GitHub account

Received on Monday, 31 July 2017 09:29:00 UTC