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

Method CreateAudioTrack

publisher.go:60–72  ·  view source on GitHub ↗

func (p *Publisher) OnEvent(event any) { p.IO.OnEvent(event) switch event.(type) { case SEclose, SEKick: p.AudioTrack = nil p.VideoTrack = nil } }

(codecID codec.AudioCodecID, stuff ...any)

Source from the content-addressed store, hash-verified

58// }
59
60func (p *Publisher) CreateAudioTrack(codecID codec.AudioCodecID, stuff ...any) common.AudioTrack {
61 switch codecID {
62 case codec.CodecID_AAC:
63 p.AudioTrack = track.NewAAC(p, stuff...)
64 case codec.CodecID_PCMA:
65 p.AudioTrack = track.NewG711(p, true, stuff...)
66 case codec.CodecID_PCMU:
67 p.AudioTrack = track.NewG711(p, false, stuff...)
68 case codec.CodecID_OPUS:
69 p.AudioTrack = track.NewOpus(p, stuff...)
70 }
71 return p.AudioTrack
72}
73
74func (p *Publisher) CreateVideoTrack(codecID codec.VideoCodecID, stuff ...any) common.VideoTrack {
75 switch codecID {

Callers 1

WriteAVCCAudioMethod · 0.95

Calls 3

NewAACFunction · 0.92
NewG711Function · 0.92
NewOpusFunction · 0.92

Tested by

no test coverage detected