MCPcopy Create free account
hub / github.com/Monibuca/engine / Attach

Method Attach

track/audio.go:23–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21}
22
23func (a *Audio) Attach() {
24 if err := a.Publisher.GetStream().AddTrack(a).Await(); err != nil {
25 a.Error("attach audio track failed", zap.Error(err))
26 } else {
27 a.Info("audio track attached", zap.Uint32("sample rate", a.SampleRate))
28 }
29}
30
31func (a *Audio) Detach() {
32 a.Publisher.GetStream().RemoveTrack(a)

Callers 1

FlushMethod · 0.95

Calls 6

AwaitMethod · 0.80
AddTrackMethod · 0.65
GetStreamMethod · 0.65
ErrorMethod · 0.65
InfoMethod · 0.65
Uint32Method · 0.45

Tested by

no test coverage detected