diff --git a/src/main/java/cn/org/hentai/jtt1078/codec/G711Codec.java b/src/main/java/cn/org/hentai/jtt1078/codec/G711Codec.java index 6a2a2177e3819002018efe1cf97c425ac0d274e6..a033b2678e5c37c1b0953cee29b07e623ea1013e 100644 --- a/src/main/java/cn/org/hentai/jtt1078/codec/G711Codec.java +++ b/src/main/java/cn/org/hentai/jtt1078/codec/G711Codec.java @@ -122,8 +122,8 @@ public class G711Codec extends AudioCodec // 如果前四字节是00 01 52 00,则是海思头,需要去掉 if (data[0] == 0x00 && data[1] == 0x01 && (data[2] & 0xff) == (data.length - 4) / 2 && data[3] == 0x00) { - temp = new byte[data.length - 8]; - System.arraycopy(data, 8, temp, 0, temp.length); + temp = new byte[data.length - 4]; + System.arraycopy(data, 4, temp, 0, temp.length); } else temp = data; diff --git a/src/main/java/cn/org/hentai/jtt1078/codec/G711UCodec.java b/src/main/java/cn/org/hentai/jtt1078/codec/G711UCodec.java index 29d7199be749e0d14db097bd00efeaab739bc5c7..19f40e8c9df99daef90cd2907253d5afb745ec9f 100644 --- a/src/main/java/cn/org/hentai/jtt1078/codec/G711UCodec.java +++ b/src/main/java/cn/org/hentai/jtt1078/codec/G711UCodec.java @@ -185,8 +185,8 @@ public class G711UCodec extends AudioCodec // 如果前四字节是00 01 52 00,则是海思头,需要去掉 if (data[0] == 0x00 && data[1] == 0x01 && (data[2] & 0xff) == (data.length - 4) / 2 && data[3] == 0x00) { - temp = new byte[data.length - 8]; - System.arraycopy(data, 8, temp, 0, temp.length); + temp = new byte[data.length - 4]; + System.arraycopy(data, 4, temp, 0, temp.length); } else temp = data;