UPixelStreamingAudioComponent

Allows in-engine playback of incoming WebRTC audio from a particular Pixel Streaming player/peer using their mic in the browser.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

PixelStreaming

Header

/Engine/Plugins/Media/PixelStreaming/Source/PixelStreaming/Public/PixelStreamingAudioComponent.h

Include

#include "PixelStreamingAudioComponent.h"

Syntax

UCLASS(Blueprintable, ClassGroup=(PixelStreamer), Meta=(BlueprintSpawnableComponent))
class UPixelStreamingAudioComponent :
    public USynthComponent,
    public IPixelStreamingAudioConsumer

Remarks

Allows in-engine playback of incoming WebRTC audio from a particular Pixel Streaming player/peer using their mic in the browser.

Each audio component associates itself with a particular Pixel Streaming player/peer (using the the Pixel Streaming player id).

Variables

Name Description

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

bool

 

bAutoFindPeer

If not already listening to a player/peer will try to attach for listening to the "PlayerToHear" each tick.

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

FString

 

PlayerToHear

The Pixel Streaming player/peer whose audio we wish to listen to.

Constructors

Name Description

Protected function

UPixelStreamingAudioComponent

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function UFunction BlueprintCallable, Category

bool

 

IsListeningToPlayer()

True if listening to a connected WebRTC peer through Pixel Streaming.

Public function UFunction BlueprintCallable, Category

bool

 

ListenTo

(
    FString PlayerToListenTo
)

Listen to a specific player. If the player is not found this component will be silent.

Public function UFunction BlueprintCallable, Category

void

 

Reset()

Stops listening to any connected player/peer and resets internal state so component is ready to listen again.

Protected function

bool

 

UpdateChannelsAndSampleRate

(
    int InNumChannels,
    int InSampleRate
)

Public function

bool

 

WillListenToAnyPlayer()

Overridden from USynthComponent

Name Description

Protected function Virtual

void

 

OnBeginGenerate()

Called when the synth component begins generating audio in render thread.

Protected function Virtual

void

 

OnEndGenerate()

Called when the synth has finished generating audio on the render thread.

Protected function Virtual

int32

 

OnGenerateAudio

(
    float* OutAudio,
    int32 NumSamples
)

Called when more audio is needed to be generated This method of generating audio is soon to be deprecated.

Overridden from UActorComponent

Name Description

Protected function Virtual

void

 

TickComponent

(
    float DeltaTime,
    ELevelTick TickType,
    FActorComponentTickFunction* T...
)

Function called every frame on this ActorComponent.

Overridden from UObject

Name Description

Protected function Virtual

void

 

BeginDestroy()

Called before destroying the object.

Overridden from IPixelStreamingAudioConsumer

Name Description

Public function Virtual

void

 

ConsumeRawPCM

(
    const int16_t* AudioData,
    int InSampleRate,
    size_t NChannels,
    size_t NFrames
)

Public function Virtual

void

 

OnConsumerAdded()

Public function Virtual

void

 

OnConsumerRemoved()