limit speaker events to microhpone track (#553)
* limit speaker events to microhpone track * PR suggestion
This commit is contained in:
@@ -635,11 +635,14 @@ func (p *ParticipantImpl) ICERestart() error {
|
|||||||
func (p *ParticipantImpl) GetAudioLevel() (level uint8, active bool) {
|
func (p *ParticipantImpl) GetAudioLevel() (level uint8, active bool) {
|
||||||
level = SilentAudioLevel
|
level = SilentAudioLevel
|
||||||
for _, pt := range p.GetPublishedTracks() {
|
for _, pt := range p.GetPublishedTracks() {
|
||||||
tl, ta := pt.(types.LocalMediaTrack).GetAudioLevel()
|
mediaTrack := pt.(types.LocalMediaTrack)
|
||||||
if ta {
|
if mediaTrack.Source() == livekit.TrackSource_MICROPHONE {
|
||||||
active = true
|
tl, ta := mediaTrack.GetAudioLevel()
|
||||||
if tl < level {
|
if ta {
|
||||||
level = tl
|
active = true
|
||||||
|
if tl < level {
|
||||||
|
level = tl
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user