PICO Unreal Platform SDK

Functions

static void PicoRtcGetToken (UObject *WorldContextObject, const FString &UserId, const FString &RoomId, int Ttl, int InValue, FOnlineManagerRtcGetTokenDelegate InRtcGetTokenDelegate)
 Gets the RTC token. More...
 
static ERtcEngineInitResult PicoGetRtcEngineInit (UObject *WorldContextObject)
 Initializes the RTC engine. More...
 
static int PicoRtcJoinRoom (UObject *WorldContextObject, const FString &RoomId, const FString &UserId, const FString &Token, const FString &UserExtra, ERtcRoomProfileType InRoomProfileType, bool bIsAutoSubscribeAudio)
 Joins a user to a RTC room. More...
 
static int RtcDestroyRoom (UObject *WorldContextObject, const FString &RoomId)
 Destroys a room. More...
 
static void RtcEnableAudioPropertiesReport (UObject *WorldContextObject, int Interval)
 Enables audio properties report. When this switch is turned on, you will regularly receive a statistical report of audio data. More...
 
static int RtcLeaveRoom (UObject *WorldContextObject, const FString &RoomId)
 Leaves a RTC room. More...
 
static void RtcMuteLocalAudio (UObject *WorldContextObject, ERtcMuteState InRtcMuteState)
 Mutes local audio to make a user's voice cannot be heard by other users in the same room. More...
 
static void RtcPublishRoom (UObject *WorldContextObject, const FString &RoomId)
 Publishes local audio stream to a room so that the voice can be heard by other users in the same room. More...
 
static void RtcUnPublishRoom (UObject *WorldContextObject, const FString &RoomId)
 Stops publishing local audio stream to a room so that other users in the same room cannot hear the voice. More...
 
static void RtcRoomPauseAllSubscribedStream (UObject *WorldContextObject, const FString &RoomId, ERtcPauseResumeMediaType InPauseResumeMediaType)
 Pauses all subscribed streams of a room. Once paused, the voice of users in the room is blocked so nothing can be heard from this room. More...
 
static void RtcRoomResumeAllSubscribedStream (UObject *WorldContextObject, const FString &RoomId, ERtcPauseResumeMediaType InPauseResumeMediaType)
 Resumes all subscribed streams of a room. Once resumed, the voice of users in the room can be heard again. More...
 
static void RtcSetAudioPlaybackDevice (UObject *WorldContextObject, ERtcAudioPlaybackDevice InRtcAudioPlaybackDevice)
 Sets the type of audio playback device. More...
 
static void RtcSetAudioScenario (UObject *WorldContextObject, ERtcAudioScenarioType InRtcAudioScenarioType)
 Sets audio scenario type. More...
 
static void RtcSetCaptureVolume (UObject *WorldContextObject, ERtcStreamIndex InRtcStreamIndex, int InVolume)
 Sets volume for audio capturing. More...
 
static void RtcSetEarMonitorMode (UObject *WorldContextObject, ERtcEarMonitorMode InRtcEarMonitorMode)
 Sets the in-ear monitoring mode. More...
 
static void RtcSetEarMonitorVolume (UObject *WorldContextObject, int InVolume)
 Sets the volume for in-ear monitoring. More...
 
static void RtcSetPlaybackVolume (UObject *WorldContextObject, int InVolume)
 Sets the playback volume. More...
 
static void RtcStartAudioCapture (UObject *WorldContextObject)
 Starts audio capturing. More...
 
static void RtcStopAudioCapture (UObject *WorldContextObject)
 Stops audio capturing. More...
 
static void RtcUpdateToken (UObject *WorldContextObject, const FString &RoomId, const FString &Token)
 Updates room token. More...
 
static int32 RtcSendStreamSyncInfo (UObject *WorldContextObject, int32 Info, ERtcStreamIndex InStreamIndex, int32 RepeatCount, ERtcSyncInfoStreamType InSyncInfoStreamType)
 Sends stream sync info. The sync info data will be sent in the same packet with the audio data. Users who subscribe to this audio stream will receive the stream sync info message. More...
 
static void RtcRoomPublishStream (UObject *WorldContextObject, const FString &RoomId, ERtcMediaStreamType InRtcMediaStreamType)
 Publishes the local audio stream to a room so that the local user's voice can be heard by other users in the same room. More...
 
static void RtcRoomSetRemoteAudioPlaybackVolume (UObject *WorldContextObject, const FString &RoomId, const FString &UserId, int32 Volume)
 Sets the volume for a remote user in a room. More...
 
static void RtcRoomSubscribeStream (UObject *WorldContextObject, const FString &RoomId, const FString &UserId, ERtcMediaStreamType InRtcMediaStreamType)
 Subscribes to the audio stream of a specific user in a room. More...
 
static void RtcRoomUnPublishStream (UObject *WorldContextObject, const FString &RoomId, ERtcMediaStreamType InRtcMediaStreamType)
 Stops publishing the local audio stream to a room, so that the other in-room users cannot hear the local user's voice. More...
 
static void RtcRoomUnsubscribeStream (UObject *WorldContextObject, const FString &RoomId, const FString &UserId, ERtcMediaStreamType InRtcMediaStreamType)
 Unsubscribes from the audio stream of a specific user in a room. More...
 
static int64 RtcSendRoomBinaryMessage (UObject *WorldContextObject, const FString &RoomId, const FString &MessageInfo)
 Sends a binary message to a room. All in-room users will receive this message. More...
 
static int64 RtcSendRoomMessage (UObject *WorldContextObject, const FString &RoomId, const FString &Message)
 Sends a text message to a room. All in-room users will receive this message. More...
 
static int64 RtcSendUserBinaryMessage (UObject *WorldContextObject, const FString &RoomId, const FString &UserId, const FString &MessageInfo)
 Sends a binary message to a user. Only the user can receive this message. More...
 
static int64 RtcSendUserMessage (UObject *WorldContextObject, const FString &RoomId, const FString &UserId, const FString &Message)
 Sends a text message to a user. Only the user can receive this message. More...
 

Detailed Description

This is the BP_RTC group

Function Documentation

◆ PicoGetRtcEngineInit()

static ERtcEngineInitResult PicoGetRtcEngineInit ( UObject *  WorldContextObject)
static

Initializes the RTC engine.

Parameters
WorldContextObjectUsed to get the information about the current world.
Returns
Voice the initialization result.

◆ PicoRtcGetToken()

static void PicoRtcGetToken ( UObject *  WorldContextObject,
const FString &  UserId,
const FString &  RoomId,
int  Ttl,
int  InValue,
FOnlineManagerRtcGetTokenDelegate  InRtcGetTokenDelegate 
)
static

Gets the RTC token.

Parameters
WorldContextObjectUsed to get the information about the current world.
UserIdUser ID.
RoomIdRoom ID.
TtlThe effective duration of the room (in seconds).
InValueChannel effective time (in seconds).
InRtcGetTokenDelegateCallback function proxy.


◆ PicoRtcJoinRoom()

static int PicoRtcJoinRoom ( UObject *  WorldContextObject,
const FString &  RoomId,
const FString &  UserId,
const FString &  Token,
const FString &  UserExtra,
ERtcRoomProfileType  InRoomProfileType,
bool  bIsAutoSubscribeAudio 
)
static

Joins a user to a RTC room.

Parameters
WorldContextObjectUsed to get the information about the current world.
RoomIdRoom ID.
UserIdUser ID.
TokenRoom token.
UserExtraExtra information added by the user.
InRoomProfileTypeRoom type:
  • 0: communication room
  • 1: live broadcasting room
  • 2: game room
  • 3: cloud game room
  • 4: low-latency room
bIsAutoSubscribeAudioWhether to automatically subscribe to the audio of the room:
  • true: yes
  • false: no
Returns
Int:
  • 0: success
  • Other values: failure

◆ RtcDestroyRoom()

static int RtcDestroyRoom ( UObject *  WorldContextObject,
const FString &  RoomId 
)
static

Destroys a room.

Parameters
WorldContextObjectUsed to get the information about the current world.
RoomIdThe ID of the room to destroy.
Returns
Int:
  • 0: success
  • Other values: failure


◆ RtcEnableAudioPropertiesReport()

static void RtcEnableAudioPropertiesReport ( UObject *  WorldContextObject,
int  Interval 
)
static

Enables audio properties report. When this switch is turned on, you will regularly receive a statistical report of audio data.

Parameters
WorldContextObjectUsed to get the information about the current world.
IntervalThe interval (in milliseconds) between one report and the next. You can set this parameter to 0 or any negative integer to stop receiving audio properties report. For any integer between (0, 100), the SDK will regard it as invalid and automatically set this parameter to 100; Any integer equals to or greater than 100 is valid.


◆ RtcLeaveRoom()

static int RtcLeaveRoom ( UObject *  WorldContextObject,
const FString &  RoomId 
)
static

Leaves a RTC room.

Parameters
WorldContextObjectUsed to get the information about the current world.
RoomIdRoom ID.
Returns
  • 0: success
  • Other values: failure


◆ RtcMuteLocalAudio()

static void RtcMuteLocalAudio ( UObject *  WorldContextObject,
ERtcMuteState  InRtcMuteState 
)
static

Mutes local audio to make a user's voice cannot be heard by other users in the same room.

Parameters
WorldContextObjectUsed to get the information about the current world.
InRtcMuteStateThe state of local audio:
  • 0: off
  • 1: on

◆ RtcPublishRoom()

static void RtcPublishRoom ( UObject *  WorldContextObject,
const FString &  RoomId 
)
static

Publishes local audio stream to a room so that the voice can be heard by other users in the same room.

Parameters
WorldContextObjectUsed to get the information about the current world.
RoomIdRoom ID.


◆ RtcRoomPauseAllSubscribedStream()

static void RtcRoomPauseAllSubscribedStream ( UObject *  WorldContextObject,
const FString &  RoomId,
ERtcPauseResumeMediaType  InPauseResumeMediaType 
)
static

Pauses all subscribed streams of a room. Once paused, the voice of users in the room is blocked so nothing can be heard from this room.

Parameters
WorldContextObjectUsed to get the information about the current world.
RoomIdRoom ID.
InPauseResumeMediaTypeMedia type.


◆ RtcRoomPublishStream()

static void RtcRoomPublishStream ( UObject *  WorldContextObject,
const FString &  RoomId,
ERtcMediaStreamType  InRtcMediaStreamType 
)
static

Publishes the local audio stream to a room so that the local user's voice can be heard by other users in the same room.

Note
  • A user can only publish the local audio stream to one room at the same time.
  • If a user wants to publish the local audio stream to another room, UnPublishRoom(oldRoomId) should be called first to stop publishing the local audio stream to the current room and then Publish(newRoomId) should be called.
Parameters
WorldContextObjectUsed to get the information about the current world.
RoomIdThe ID of the room that the local audio stream is published to.
InRtcMediaStreamTypeThe media stream type:
  • 0: Audio
  • 1: Video
  • 2: Both
  • 3: None

◆ RtcRoomResumeAllSubscribedStream()

static void RtcRoomResumeAllSubscribedStream ( UObject *  WorldContextObject,
const FString &  RoomId,
ERtcPauseResumeMediaType  InPauseResumeMediaType 
)
static

Resumes all subscribed streams of a room. Once resumed, the voice of users in the room can be heard again.

Parameters
WorldContextObjectUsed to get the information about the current world.
RoomIdThe ID of the room to resume subscribed streams for.
InPauseResumeMediaTypeMedia type.


◆ RtcRoomSetRemoteAudioPlaybackVolume()

static void RtcRoomSetRemoteAudioPlaybackVolume ( UObject *  WorldContextObject,
const FString &  RoomId,
const FString &  UserId,
int32  Volume 
)
static

Sets the volume for a remote user in a room.

Parameters
WorldContextObjectUsed to get the information about the current world.
RoomIdRoom ID.
UserIdThe ID of the remote user.
VolumeThe volume to set for the remote user, which ranges from 0 to 400. 100 indicates the default volume.

◆ RtcRoomSubscribeStream()

static void RtcRoomSubscribeStream ( UObject *  WorldContextObject,
const FString &  RoomId,
const FString &  UserId,
ERtcMediaStreamType  InRtcMediaStreamType 
)
static

Subscribes to the audio stream of a specific user in a room.

Parameters
WorldContextObjectUsed to get the information about the current world.
RoomIdRoom ID.
UserIdThe ID of the user in the room.
InRtcMediaStreamTypeThe media stream type:
  • 0: Audio
  • 1: Video
  • 2: Both
  • 3: None

◆ RtcRoomUnPublishStream()

static void RtcRoomUnPublishStream ( UObject *  WorldContextObject,
const FString &  RoomId,
ERtcMediaStreamType  InRtcMediaStreamType 
)
static

Stops publishing the local audio stream to a room, so that the other in-room users cannot hear the local user's voice.

Parameters
WorldContextObjectUsed to get the information about the current world.
RoomIdThe ID of the room to stop publishing the local audio stream to.
InRtcMediaStreamTypeThe media stream type:
  • 0: Audio
  • 1: Video
  • 2: Both
  • 3: None

◆ RtcRoomUnsubscribeStream()

static void RtcRoomUnsubscribeStream ( UObject *  WorldContextObject,
const FString &  RoomId,
const FString &  UserId,
ERtcMediaStreamType  InRtcMediaStreamType 
)
static

Unsubscribes from the audio stream of a specific user in a room.

Parameters
WorldContextObjectUsed to get the information about the current world.
RoomIdRoom ID.
UserIdThe ID of the user in the room.
InRtcMediaStreamTypeThe media stream type:
  • 0: Audio
  • 1: Video
  • 2: Both
  • 3: None

◆ RtcSendRoomBinaryMessage()

static int64 RtcSendRoomBinaryMessage ( UObject *  WorldContextObject,
const FString &  RoomId,
const FString &  MessageInfo 
)
static

Sends a binary message to a room. All in-room users will receive this message.

Parameters
WorldContextObjectUsed to get the information about the current world.
RoomIdThe ID of the room to which the binary message is to be sent.
MessageInfoThe binary message to be sent.
Returns
A room message ID of type int64, which is automatically generated and incremented.

◆ RtcSendRoomMessage()

static int64 RtcSendRoomMessage ( UObject *  WorldContextObject,
const FString &  RoomId,
const FString &  Message 
)
static

Sends a text message to a room. All in-room users will receive this message.

Parameters
WorldContextObjectUsed to get the information about the current world.
RoomIdThe ID of the room to which the text message is to be sent.
MessageThe message to be sent.
Returns
A room message ID of type int64, which is automatically generated and incremented.

◆ RtcSendStreamSyncInfo()

static int32 RtcSendStreamSyncInfo ( UObject *  WorldContextObject,
int32  Info,
ERtcStreamIndex  InStreamIndex,
int32  RepeatCount,
ERtcSyncInfoStreamType  InSyncInfoStreamType 
)
static

Sends stream sync info. The sync info data will be sent in the same packet with the audio data. Users who subscribe to this audio stream will receive the stream sync info message.

Parameters
WorldContextObjectUsed to get the information about the current world.
InfoThe stream sync info.
InStreamIndexThe Stream index:
  • 0: Main
  • 1: Screen
  • 2: None
RepeatCountThe stream sync info will be sent repeatedly for the times set in repeatCount. It's designed to avoid losing package and to ensure that the sync info can be sent successfully. However, if repeatCount is too large, it will cause the sync info to pile up in the queue. It is recommended to set this parameter to 1.
InSyncInfoStreamTypeThe sync info stream type:
  • 0: Audio
  • 1: None
Returns
Any code which equals to or below 0 indicates success, and other codes indicate failure.
Code Description
>=0 Send successfully. Indicates the times sent successfully.
-1 Send Failed. Message length exceeded 255B.
-2 Send Failed. The data is empty.
-3 Send Failed. Send sync info with a un-publish screen stream.
-4 Send Failed. Send sync info with a un-publish audio stream.

◆ RtcSendUserBinaryMessage()

static int64 RtcSendUserBinaryMessage ( UObject *  WorldContextObject,
const FString &  RoomId,
const FString &  UserId,
const FString &  MessageInfo 
)
static

Sends a binary message to a user. Only the user can receive this message.

Parameters
WorldContextObjectUsed to get the information about the current world.
RoomIdThe ID of the room the user is in.
UserIdThe ID of the user the message is sent to.
MessageInfoThe message to be sent.
Returns
A room message ID of type int64, which is automatically generated and incremented.

◆ RtcSendUserMessage()

static int64 RtcSendUserMessage ( UObject *  WorldContextObject,
const FString &  RoomId,
const FString &  UserId,
const FString &  Message 
)
static

Sends a text message to a user. Only the user can receive this message.

Parameters
WorldContextObjectUsed to get the information about the current world.
RoomIdThe ID of the room the user is in.
UserIdThe ID of the user the message is sent to.
MessageThe message to be sent.
Returns
A room message ID of type int64, which is automatically generated and incremented.

◆ RtcSetAudioPlaybackDevice()

static void RtcSetAudioPlaybackDevice ( UObject *  WorldContextObject,
ERtcAudioPlaybackDevice  InRtcAudioPlaybackDevice 
)
static

Sets the type of audio playback device.

Parameters
WorldContextObjectUsed to get the information about the current world.
InRtcAudioPlaybackDeviceDevice type.


◆ RtcSetAudioScenario()

static void RtcSetAudioScenario ( UObject *  WorldContextObject,
ERtcAudioScenarioType  InRtcAudioScenarioType 
)
static

Sets audio scenario type.

Parameters
WorldContextObjectUsed to get the information about the current world.
InRtcAudioScenarioTypeAudio scenario type:
  • 0: Music
  • 1: HighQualityCommunication
  • 2: Communication
  • 3: Media
  • 4: GameStreaming


◆ RtcSetCaptureVolume()

static void RtcSetCaptureVolume ( UObject *  WorldContextObject,
ERtcStreamIndex  InRtcStreamIndex,
int  InVolume 
)
static

Sets volume for audio capturing.

Parameters
WorldContextObjectUsed to get the information about the current world.
InRtcStreamIndexStream index main/screen.
InVolumeThe volume. The valid value ranges from 0 to 400. 100 indicates keeping the original volume.


◆ RtcSetEarMonitorMode()

static void RtcSetEarMonitorMode ( UObject *  WorldContextObject,
ERtcEarMonitorMode  InRtcEarMonitorMode 
)
static

Sets the in-ear monitoring mode.

Parameters
WorldContextObjectUsed to get the information about the current world.
InRtcEarMonitorModeThe state of in-ear monitoring mode:
  • 0: off
  • 1: on


◆ RtcSetEarMonitorVolume()

static void RtcSetEarMonitorVolume ( UObject *  WorldContextObject,
int  InVolume 
)
static

Sets the volume for in-ear monitoring.

Parameters
WorldContextObjectUsed to get the information about the current world.
InVolumeThe volume. The valid value ranges from 0 to 400. 100 indicates keeping the original volume.


◆ RtcSetPlaybackVolume()

static void RtcSetPlaybackVolume ( UObject *  WorldContextObject,
int  InVolume 
)
static

Sets the playback volume.

Parameters
WorldContextObjectUsed to get the information about the current world.
InVolumeThe volume. The valid value ranges from 0 to 400. 100 indicates keeping the original volume.


◆ RtcStartAudioCapture()

static void RtcStartAudioCapture ( UObject *  WorldContextObject)
static

Starts audio capturing.

Parameters
WorldContextObjectUsed to get the information about the current world.


◆ RtcStopAudioCapture()

static void RtcStopAudioCapture ( UObject *  WorldContextObject)
static

Stops audio capturing.

Parameters
WorldContextObjectUsed to get the information about the current world.


◆ RtcUnPublishRoom()

static void RtcUnPublishRoom ( UObject *  WorldContextObject,
const FString &  RoomId 
)
static

Stops publishing local audio stream to a room so that other users in the same room cannot hear the voice.

Parameters
WorldContextObjectUsed to get the information about the current world.
RoomIdRoom ID.


◆ RtcUpdateToken()

static void RtcUpdateToken ( UObject *  WorldContextObject,
const FString &  RoomId,
const FString &  Token 
)
static

Updates room token.

Parameters
WorldContextObjectUsed to get the information about the current world.
RoomIdRoom ID.
TokenThe new token.