Process header extensions in line (#635)

* WIP commit

* Pass audio config

* Fix test compile
This commit is contained in:
Raja Subramanian
2022-04-20 18:20:28 +05:30
committed by GitHub
parent 1fe485ef0c
commit 6a53891f9f
9 changed files with 155 additions and 161 deletions
+3 -2
View File
@@ -16,6 +16,7 @@ import (
"github.com/livekit/livekit-server/pkg/config"
"github.com/livekit/livekit-server/pkg/routing"
"github.com/livekit/livekit-server/pkg/rtc/types"
"github.com/livekit/livekit-server/pkg/sfu/audio"
"github.com/livekit/livekit-server/pkg/sfu/buffer"
"github.com/livekit/livekit-server/pkg/telemetry"
"github.com/livekit/livekit-server/pkg/telemetry/prometheus"
@@ -130,7 +131,7 @@ func (r *Room) GetActiveSpeakers() []*livekit.SpeakerInfo {
}
speakers = append(speakers, &livekit.SpeakerInfo{
Sid: string(p.ID()),
Level: ConvertAudioLevel(level),
Level: audio.ConvertAudioLevel(level),
Active: active,
})
}
@@ -768,7 +769,7 @@ func (r *Room) audioUpdateWorker() {
smoothValues = make(map[livekit.ParticipantID]float32)
// exponential moving average (EMA), same center of mass with simple moving average (SMA)
smoothFactor = 2 / float32(ss+1)
activeThreshold = ConvertAudioLevel(r.audioConfig.ActiveLevel)
activeThreshold = audio.ConvertAudioLevel(r.audioConfig.ActiveLevel)
}
lastActiveMap := make(map[livekit.ParticipantID]*livekit.SpeakerInfo)