FOnlineVoiceImpl

The generic implementation of the voice interface

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

IOnlineVoice

FOnlineVoiceImpl

References

Module

OnlineSubsystemUtils

Header

/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Public/VoiceInterfaceImpl.h

Include

#include "VoiceInterfaceImpl.h"

Syntax

class FOnlineVoiceImpl : public IOnlineVoice

Remarks

The generic implementation of the voice interface

Variables

Name Description

Protected variable

IOnlineIdentity...

 

IdentityInt

Reference to the profile interface

Protected variable

TArray< FLocalT...

 

LocalTalkers

State of all possible local talkers

Protected variable

int32

 

MaxLocalTalkers

Maximum permitted local talkers

Protected variable

int32

 

MaxRemoteTalkers

Maximum permitted remote talkers

Protected variable

TArray< FUnique...

 

MuteList

All remote players locally muted (super set of SystemMuteList)

Protected variable

IOnlineSubsyste...

 

OnlineSubsystem

Reference to the main online subsystem

Protected variable

TArray< FRemote...

 

RemoteTalkers

State of all possible remote talkers

Protected variable

IOnlineSession ...

 

SessionInt

Reference to the sessions interface

Protected variable

TArray< FUnique...

 

SystemMuteList

Remote players locally muted explicitly

Protected variable

FVoiceDataImpl

 

VoiceData

Buffered voice data I/O

Protected variable

IVoiceEnginePtr

 

VoiceEngine

Reference to the voice engine for acquiring voice data

Protected variable

float

 

VoiceNotificationDelta

Time to wait for new data before triggering "not talking"

Constructors

Name Description

Protected function

FOnlineVoiceImpl()

Public function

FOnlineVoiceImpl

(
    IOnlineSubsystem* InOnlineSubs...
)

Constructor

Destructors

Name Description

Public function Virtual

~FOnlineVoiceImpl()

Virtual destructor to force proper child cleanup

Functions

Name Description

Protected function Virtual

FRemoteTalke...

 

FindRemoteTalker

(
    const FUniqueNetId& UniqueId
)

Finds a remote talker in the cached list

Protected function Virtual Const

bool

 

IsLocallyMuted

(
    const FUniqueNetId& UniqueId
)

Is a given id presently muted (either by system mute or game server)

Protected function Virtual Const

bool

 

IsSystemWideMuted

(
    const FUniqueNetId& UniqueId
)

Does a given id exist in the system wide mute list

Protected function Virtual

void

 

ProcessLocalVoicePackets()

Reads any data that is currently queued

Protected function Virtual

void

 

ProcessRemoteVoicePackets()

Submits network packets to audio system for playback

Protected function Virtual

void

 

ProcessTalkingDelegates

(
    float DeltaTime
)

Processes any talking delegates that need to be fired off

Protected function Virtual

void

 

UpdateMuteListForLocalTalker

(
    int32 TalkerIndex,
    APlayerController* PlayerContr...
)

Figures out which remote talkers need to be muted for a given local talker

Overridden from IOnlineVoice

Name Description

Public function Virtual

void

 

ClearVoicePackets()

Clears all voice packets currently queued for send

Protected function Virtual

IVoiceEngine...

 

CreateVoiceEngine()

Public function Virtual

void

 

DisconnectAllEndpoints()

When called, disconnects all additional audio endpoints we patched to using PatchRemoteTalkerOutputToEndpoint().

Public function Virtual

float

 

GetAmplitudeOfRemoteTalker

(
    const FUniqueNetId& PlayerId
)

This returns the current amplitude of a given player's incoming audio.

Public function Virtual

TSharedPtr< ...

 

GetLocalPacket

(
    uint32 LocalUserNum
)

Get the local voice packet intended for send

Public function Virtual

Audio::FPatc...

 

GetMicrophoneOutput()

This can be used to get arbitrarily tap outgoing microphone audio from local players to use elsewhere in your application.

Public function Virtual

int32

 

GetNumLocalTalkers()

Public function Virtual

Audio::FPatc...

 

GetRemoteTalkerOutput()

This can be used to get arbitrarily tap incoming VOIP audio from remote players to use elsewhere in your application.

Public function Virtual Const

FString

 

GetVoiceDebugState()

Get information about the voice state for display

Protected function Virtual

bool

 

Init()

IOnlineVoice.

Public function Virtual

bool

 

IsHeadsetPresent

(
    uint32 LocalUserNum
)

Checks whether a local user index has a headset present or not

Public function Virtual

bool

 

IsLocalPlayerTalking

(
    uint32 LocalUserNum
)

Determines whether a local user index is currently talking or not

Public function Virtual Const

bool

 

IsMuted

(
    uint32 LocalUserNum,
    const FUniqueNetId& UniqueId
)

Checks that a unique player id is on the specified user's mute list

Public function Virtual

bool

 

IsRemotePlayerTalking

(
    const FUniqueNetId& UniqueId
)

Determines whether a remote talker is currently talking or not

Public function Virtual

bool

 

MuteRemoteTalker

(
    uint8 LocalUserNum,
    const FUniqueNetId& PlayerId,
    bool bIsSystemWide
)

Mutes a remote talker for the specified local player.

Public function Virtual

bool

 

PatchLocalTalkerOutputToEndpoint

(
    const FString& InDeviceName
)

This can be used to patch outgoing audio to a different audio device.

Public function Virtual

bool

 

PatchRemoteTalkerOutputToEndpoint

(
    const FString& InDeviceName,
    bool bMuteInGameOutput
)

This can be used to patch incoming audio to a different audio device.

Protected function Virtual

void

 

ProcessMuteChangeNotification()

Re-evaluates the muting list for all local talkers

Public function Virtual

bool

 

RegisterLocalTalker

(
    uint32 LocalUserNum
)

Registers the user index as a local talker (interested in voice data)

Public function Virtual

void

 

RegisterLocalTalkers()

Registers all signed in local talkers

Public function Virtual

bool

 

RegisterRemoteTalker

(
    const FUniqueNetId& UniqueId
)

Registers the unique player id as a remote talker (submitted voice data only)

Public function Virtual

void

 

RemoveAllRemoteTalkers()

Iterates the current remote talker list unregistering them with the voice engine and our internal state

Public function Virtual

TSharedPtr< ...

 

SerializeRemotePacket

(
    FArchive& Ar
)

Convert generic network packet data back into voice data

Protected function Virtual

void

 

Shutdown()

Cleanup voice interface

Public function Virtual

void

 

StartNetworkedVoice

(
    uint8 LocalUserNum
)

IOnlineVoice.

Public function Virtual

void

 

StopNetworkedVoice

(
    uint8 LocalUserNum
)

Tells the voice layer to stop processing networked voice support for the specified player.

Public function Virtual

void

 

Tick

(
    float DeltaTime
)

Allows for platform specific servicing of devices, etc.

Public function Virtual

bool

 

UnmuteRemoteTalker

(
    uint8 LocalUserNum,
    const FUniqueNetId& PlayerId,
    bool bIsSystemWide
)

Allows a remote talker to talk to the specified local player.

Public function Virtual

bool

 

UnregisterLocalTalker

(
    uint32 LocalUserNum
)

Unregisters the user index as a local talker (not interested in voice data)

Public function Virtual

void

 

UnregisterLocalTalkers()

Unregisters all signed in local talkers

Public function Virtual

bool

 

UnregisterRemoteTalker

(
    const FUniqueNetId& UniqueId
)

Unregisters the unique player id as a remote talker