Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat small program API real-time voice , join (create) real-time voice calls


May 19, 2021 WeChat Mini Program Development Document


Table of contents


wx.joinVoIPChat(Object object)

Base library 2.7.0 starts to support, and low versions need to be compatible.
User authorization scope.record is required before the call can be made

Join (create) live voice calls, and more information can be found in the Live Voice Guide

Parameters

Object object

Property Type The default Required Description
roomType String voice Whether The type of room
signature String Is Signature to verify the identity of the game
nonceStr String Is Verify the random string required
timeStamp Number Is The timestamp required to verify
groupId String Is ID of this room/group chat in a small game. Users who pass in the same groupId at the same time enter the same real-time voice room.
muteConfig Object Whether Mute settings
success function Whether The interface calls a successful callback function
fail function Whether The interface calls the failed callback function
complete function Whether Callback function at end of interface call (call succeeds, fails are executed)

The legal value of object.roomType

Value Description The lowest version
voice Audio room for voice calls
video Video room, combined with the voip-room component, displays the member screen

The structure of object.muteConfig

Property Type The default Required Description
muteMicrophone Boolean false Whether Whether to mute the microphone
muteEarphone Boolean false Whether Whether to mute the headset

object.success callback function

Parameters
Object res
Property Type Description
openIdList Array.<String> Members in this call OpenID list
errCode Number error code
errMsg String Call result

mistake

error code Error message illustrate
-1 Is currently in the room
-2 The recording device is occupied, possibly using voice or system calls on WeChat
-3 Exiting during a join session (possibly because the user actively quits, or returning to the background, in a call, etc.), the join failed
-1000 System error