How to use AudioReceiverStats.AudioLevel #2079
Unanswered
PavelToropynya
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a question may i configure audioLevel for different senders using AudioLevel field. I changed AudioLevel value when i saved .ogg audio file on disk. But it's doesn't change something. Does this feature work properly and how we can use it. Thanks.
audioStats := webrtc.AudioReceiverStats{} audioStats.AudioLevel = 0.0 peerConnection.OnTrack(func(t *webrtc.TrackRemote, _ *webrtc.RTPReceiver) { // Create a track to fan out our incoming video to all peers // Send a PLI on an interval so that the publisher is pushing a keyframe every rtcpPLIInterval go func() { ticker := time.NewTicker(time.Second * 3) for range ticker.C { errSend := peerConnection.WriteRTCP([]rtcp.Packet{&rtcp.PictureLossIndication{MediaSSRC: uint32(t.SSRC())}}) if errSend != nil { fmt.Println(errSend) } } }() codec := t.Codec() if strings.EqualFold(codec.MimeType, webrtc.MimeTypeOpus) { fmt.Println("Got Opus track, saving to disk as output.opus (48 kHz, 2 channels)") saveToDisk(oggFile, t) } else if strings.EqualFold(codec.MimeType, webrtc.MimeTypeVP8) { fmt.Println("Got VP8 track, saving to disk as output.ivf") saveToDisk(h264File, t) } })
Beta Was this translation helpful? Give feedback.
All reactions