Use blank frames at frame rate (#710)

* Inject silence opus frames on mute.

If not, under certain circumstances, residual noise
seems to trigger comfort noise generation at the decoder
which is not all that comfortable.

* inject silence only when muting

* Add comment

* augment comment

* Delete blank line

* Adjust TS offset on blank frames

* Remove debug

* Do not modify `lastTS` as it affects timestamp on next switch.

* Trying more stuff for DTX

* - Use a go routine to send blank frames
- Use duration instead of number of frames and calculate number of
  frames

* augment comment

* Remove debug

* Return a chan from writeBlankFrameRTP

* Use a long duration for mute

* add comment

* Incorporate suggestion from Jie
This commit is contained in:
Raja Subramanian
2022-05-24 13:25:19 +05:30
committed by GitHub
parent 33032f6c4b
commit 9d0e4375f2
5 changed files with 106 additions and 72 deletions
+3
View File
@@ -228,6 +228,9 @@ func (r *RTPMunger) UpdateAndGetPaddingSnTs(num int, clockRate uint32, frameRate
r.lastSN = vals[num-1].sequenceNumber
r.snOffset -= uint16(num)
r.tsOffset -= vals[num-1].timestamp - r.lastTS
r.lastTS = vals[num-1].timestamp
if forceMarker {
r.lastMarker = true
}