1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 11:07:40 +08:00

update codec.

This commit is contained in:
Mrs4s 2020-08-25 13:28:41 +08:00
parent 16fc454f75
commit d3b0f5f9e8

View File

@ -539,13 +539,7 @@ func (c *QQClient) uploadPrivateImage(target int64, img []byte, count int) (*mes
func (c *QQClient) UploadGroupPtt(groupCode int64, voice []byte) (*message.GroupVoiceElement, error) {
h := md5.Sum(voice)
codec := func() int32 {
if bytes.HasPrefix(voice, []byte("#!AMR")) {
return 0
}
return 1
}()
seq, pkt := c.buildGroupPttStorePacket(groupCode, h[:], int32(len(voice)), codec, int32(len(voice)))
seq, pkt := c.buildGroupPttStorePacket(groupCode, h[:], int32(len(voice)), 0, int32(len(voice)))
r, err := c.sendAndWait(seq, pkt)
if err != nil {
return nil, err