mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 11:07:40 +08:00
update codec.
This commit is contained in:
parent
16fc454f75
commit
d3b0f5f9e8
@ -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) {
|
func (c *QQClient) UploadGroupPtt(groupCode int64, voice []byte) (*message.GroupVoiceElement, error) {
|
||||||
h := md5.Sum(voice)
|
h := md5.Sum(voice)
|
||||||
codec := func() int32 {
|
seq, pkt := c.buildGroupPttStorePacket(groupCode, h[:], int32(len(voice)), 0, int32(len(voice)))
|
||||||
if bytes.HasPrefix(voice, []byte("#!AMR")) {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
return 1
|
|
||||||
}()
|
|
||||||
seq, pkt := c.buildGroupPttStorePacket(groupCode, h[:], int32(len(voice)), codec, int32(len(voice)))
|
|
||||||
r, err := c.sendAndWait(seq, pkt)
|
r, err := c.sendAndWait(seq, pkt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user