![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <IAudioEndpoint.h>
Protected Member Functions | |
| virtual AUDIOEXTENSIONS_API float | GetSampleRate () const |
| virtual AUDIOEXTENSIONS_API int32 | GetNumChannels () const |
| virtual bool | EndpointRequiresCallback () const |
| virtual int32 | GetDesiredNumFrames () const |
| virtual bool | OnAudioCallback (const TArrayView< const float > &InAudio, const int32 &NumChannels, const IAudioEndpointSettingsProxy *InSettings) |
| AUDIOEXTENSIONS_API int32 | PopAudio (float *OutAudio, int32 NumSamples) |
| AUDIOEXTENSIONS_API void | PollSettings (TFunctionRef< void(const IAudioEndpointSettingsProxy *)> NewSettingsRetrieved) |
| AUDIOEXTENSIONS_API void | DisconnectAllInputs () |
| AUDIOEXTENSIONS_API void | StartRunningAsyncCallback () |
| AUDIOEXTENSIONS_API void | StopRunningAsyncCallback () |
| AUDIOEXTENSIONS_API void | RunCallbackSynchronously () |
Class that allows audio to be sent to an arbitrary locale. This can be used for multi-device rendering, haptics systems, etc. Note that this only for interleaved audio buffers with no metadata for object-based or soundfield-based rendering. For those, see
|
inlinevirtual |
|
protected |
Thread safe function to disconnect everything from this endpoint. Anything that owns an Audio::FPatchInput will be notified and will have to call PatchNewInput() again to reconnect.
OPTIONAL OVERRIDES: For endpoints that do not explicitly fire a timed callback to poll audio data, this should be overridden to return true, and OnAudioCallback and GetDesiredNumFrames should be overridden.
|
protectedvirtual |
This should return the number of channels we should be sending to this endpoint. If the number of channels changes, please call DisconnectAllInputs.
|
protectedvirtual |
REQUIRED OVERRIDES: This should return the sample rate we should be sending to this endpoint. If the sample rate changes, please call DisconnectAllInputs().
|
virtual |
Whether this endpoint is of an implemented type
|
inlineprotectedvirtual |
For endpoints that override EndpointRequiresCallback to return true, this callback will be called every (GetDesiredNumFrames() / GetSampleRate()) seconds.
| Audio::FPatchInput IAudioEndpoint::PatchNewInput | ( | float | ExpectedDurationPerRender, |
| float & | OutSampleRate, | ||
| int32 & | OutNumChannels | ||
| ) |
Create a new patch point for this endpoint. Please see MultithreadedPatching.h to see how to use the FPatchInput class.
| [in] | ExpectedDurationPerRender | The worst-case amount of time expected between render callbacks. This is used to determined how much to allocate for this input. |
| [out] | OutSampleRate. | The sample rate expected to be pushed to the returned FPatchInput. If you need to resample your input, please see Audio::FResampler. |
| [out] | OutNumChannels. | The number of channels expected to be pushed to the returned FPatchInput. If you need to downmix or upmix your input, try using the following: TArray<float> MixdownGainsMap; Audio::FMixerDevice::Get2DChannelMap(false, NumInputChannels, NumOutputChannels, false, MixdownGainsMap); Audio::DownmixBuffer(NumInputChannels, NumOutputChannels, InputAudio, OutputAudio, MixdownGainsMap.GetData()); |
|
protected |
Use this as a thread safe way to use the current settings posted to this IAudioEndpoint. Locks with IAudioEndpoint::SetSettings.
| [in] | NewSettingsRetrieved | lambda used to work with the retrieved settings. This lambda is called immediately and synchronously, but is used to safely scope usage of the IAudioEndpointSettingsProxy pointer. |
METHODS USED BY IMPLEMENTATIONS OF IAudioEndpoint: This is used by the IAudioEndpoint implementation to poll buffered audio to process or send to the endpoint. Note that this is NOT thread safe if EndpointRequiresCallback() is overridden to return true. If that is the case, use an override of OnAudioCallback instead.
| [in] | OutAudio | Pointer to already allocated buffer of floats, at least NumSamples long. This will be filled with interleaved audio based on GetNumChannels(). |
| [in] | NumSamples | The number of samples to fill OutAudio with. |
| void IAudioEndpoint::ProcessAudioIfNeccessary | ( | ) |
If this audio endpoint hasn't spawned a seperate callback thread but requires a callback, this should be executed somewhere.
|
protected |
If EndpointRequiresCallback() returns true, this can be used to manually run the callback.
| void IAudioEndpoint::SetNewSettings | ( | TUniquePtr< IAudioEndpointSettingsProxy > && | InNewSettings | ) |
Post new settings for this endpoint. There is no type safety on this call, so make sure that you are using the correct implementation of IAudioEndpointSettingsProxy for this implementation of IAudioEndpoint.
|
protected |
If EndpointRequiresCallback() returns true, this can be used to spawn an async thread and begin calling OnAudioCallback.
|
protected |