Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions codec/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import (
)

type OpusCodecData struct {
typ av.CodecType
Typ av.CodecType
SampleRate_ int
ChannelLayout_ av.ChannelLayout
}

func (self OpusCodecData) Type() av.CodecType {
return self.typ
return self.Typ
}

func (self OpusCodecData) SampleRate() int {
Expand All @@ -34,11 +34,11 @@ func (self OpusCodecData) SampleFormat() av.SampleFormat {
}

type PCMUCodecData struct {
typ av.CodecType
Typ av.CodecType
}

func (self PCMUCodecData) Type() av.CodecType {
return self.typ
return self.Typ
}

func (self PCMUCodecData) SampleRate() int {
Expand All @@ -59,24 +59,24 @@ func (self PCMUCodecData) PacketDuration(data []byte) (time.Duration, error) {

func NewPCMMulawCodecData() av.AudioCodecData {
return PCMUCodecData{
typ: av.PCM_MULAW,
Typ: av.PCM_MULAW,
}
}

func NewPCMCodecData() av.AudioCodecData {
return PCMUCodecData{
typ: av.PCM,
Typ: av.PCM,
}
}

func NewPCMAlawCodecData() av.AudioCodecData {
return PCMUCodecData{
typ: av.PCM_ALAW,
Typ: av.PCM_ALAW,
}
}
func NewOpusCodecData(sr int, cc av.ChannelLayout) av.AudioCodecData {
return OpusCodecData{
typ: av.OPUS,
Typ: av.OPUS,
SampleRate_: sr,
ChannelLayout_: cc,
}
Expand Down