Change codec channels from uint16 to uint8

This commit is contained in:
Alex X
2025-03-25 15:31:43 +03:00
parent f535595d1f
commit e1342f06b7
8 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ func ConfigToCodec(conf []byte) *core.Codec {
codec.ClockRate = rd.ReadBits(24)
}
codec.Channels = rd.ReadBits16(4)
codec.Channels = rd.ReadBits8(4)
return codec
}
+2 -2
View File
@@ -28,7 +28,7 @@ func ADTSToCodec(b []byte) *core.Codec {
objType := rd.ReadBits8(2) + 1 // Profile, the MPEG-4 Audio Object Type minus 1
sampleRateIdx := rd.ReadBits8(4) // MPEG-4 Sampling Frequency Index
_ = rd.ReadBit() // Private bit, guaranteed never to be used by MPEG, set to 0 when encoding, ignore when decoding
channels := rd.ReadBits16(3) // MPEG-4 Channel Configuration
channels := rd.ReadBits8(3) // MPEG-4 Channel Configuration
//_ = rd.ReadBit() // Originality, set to 1 to signal originality of the audio and 0 otherwise
//_ = rd.ReadBit() // Home, set to 1 to signal home usage of the audio and 0 otherwise
@@ -43,7 +43,7 @@ func ADTSToCodec(b []byte) *core.Codec {
wr := bits.NewWriter(nil)
wr.WriteBits8(objType, 5)
wr.WriteBits8(sampleRateIdx, 4)
wr.WriteBits16(channels, 4)
wr.WriteBits8(channels, 4)
conf := wr.Bytes()
codec := &core.Codec{