Pixel Streaming — how to stream audio without playing it locally?

Hi everyone,

I’m working on a Pixel Streaming setup in UE5 and I need to send audio to the stream without it being reproduced locally on the server machine.

Is there any way to achieve this?

Thanks!

Hey @Feanor :waving_hand:

As far as I’m aware, this functionality is not possible using the old Pixel Streaming plugin.

However, if you are able to use Pixel Streaming 2, then this can easily be achieved.

#include "IPixelStreaming2AudioProducer.h"

class FMyAudioProducer : public IPixelStreaming2AudioProducer
{
public:
    FMyAudioProducer() = default;
    virtual ~FMyAudioProducer() = default;
};


/**
* Execute this block wherever you see fit.
*/
// Obtain a TSharedPtr<IPixelStreaming2Streamer>. This can be either the default streamer obtained from the IPixelStreaming2Module or a custom streamer if you are using that
TSharedPtr<IPixelStreaming2Streamer> Streamer = /* Obtain somehow */;
TSharedPtr<FMyAudioProducer> AudioProducer = MakeShared<FMyAudioProducer>();

Streamer->AddAudioProducer(AudioProducer);

/**
* Now all that is required for your audio producer to stream audio is to call AudioProducer->PushAudio(const float* InBuffer, int32 NumSamples, int32 NumChannels, int32 SampleRate)
*
* Obtaining audio is outside the scope of this example and is up to you depending on what audio you want to stream
*/

Hope this helps!

Cheers