limit speaker events to microhpone track (#553)
* limit speaker events to microhpone track * PR suggestion
This commit is contained in:
@@ -635,7 +635,9 @@ 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 mediaTrack.Source() == livekit.TrackSource_MICROPHONE {
|
||||||
|
tl, ta := mediaTrack.GetAudioLevel()
|
||||||
if ta {
|
if ta {
|
||||||
active = true
|
active = true
|
||||||
if tl < level {
|
if tl < level {
|
||||||
@@ -643,6 +645,7 @@ func (p *ParticipantImpl) GetAudioLevel() (level uint8, active bool) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user