D
D
Danila Stavrov2017-10-26 15:21:31
In contact with
Danila Stavrov, 2017-10-26 15:21:31

How to receive a VK voice message?

Actually the whole question is how to receive / download a voice message that was sent as a personal message to a group using vkapi

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
mailf, 2017-10-26
@mailf

As far as I remember, when you receive messages in the attachment array, there is a link to an audio file.
Haven't worked with vkapi for a long time, I may be wrong

D
Danila Stavrov, 2017-10-26
@Vicrus

Thank you! There was a link in attachments

{
  "b'{\"type\":\"message_new\",\"object\":" {
    "id": 111,
    "date": 1111111111,
    "out": 0,
    "user_id": 111111111,
    "read_state": 0,
    "title": "",
    "body": "",
    "attachments": [
      {
        "type": "doc",
        "doc": {
          "id": 111111111,
          "owner_id": 111111111,
          "title": "voice_message.webm",
          "size": 00000,
          "ext": "ogg",
          "url": "https:\\/xxxxx",
          "date": xxxxxxxxxx,
          "type": 5,
          "preview": {
            "audio_msg": {
              "duration": 0,
              "waveform": [ 0, 0, 0, 6, 6, 6 ],
              "link_ogg": "https:\\/xxxxx",
              "link_mp3": "https:\\/xxxxx"
            }
          },
          "access_key": "xxxxxxxxxxxxxxxxx"
        }
      }
    ]
  },
  "group_id": 000000000
}'
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question