Skip to main content
Version: 2.x

UOdinRestGSTTEffect

Codec-Effect for the odin audio pipeline. The effect will cache audio in a file based on a timer. Used in a remote web sample check for speech-to-text content check.

Declaration
UCLASS(ClassGroup = Odin)
class ODIN_API UOdinRestGSTTEffect : public UOdinCustomEffect
warning

Deprecated: This will be included or replaced by the 4Players/ue-filter-plugin extension.

Overview​

Functions​

NameDescription
Callback
ConstructRestGSTTEffectCreates a generic speech-to-text (STT) effect, a base for C++ integrations with REST speech-to-text services.
PostRequest
Remix

Properties​

NameDescription
SampleRateSample rate of the incoming audio.
ResampleRateSample rate the collected audio is resampled to.
bStereoTrue if the incoming audio is interleaved stereo.
TimerSeconds of audio to collect before it is handed on.
UserData

Functions​

Callback​

Virtual · Const · Inline

virtual void Callback(Audio::FAlignedFloatBuffer Buffer, FString Name, FString NameSpace) const;
ParameterTypeDescription
BufferAudio::FAlignedFloatBuffer
NameFString
NameSpaceFString

ConstructRestGSTTEffect​

Static · Blueprint: Construct Generic STT Effect

Creates a generic speech-to-text (STT) effect, a base for C++ integrations with REST speech-to-text services. It collects the audio for Timer seconds, resamples it to Resample Rate and hands it to its C++ Callback method. A C++ subclass overrides Callback and posts the audio to a service with PostRequest; the service's response is raised through Post Response. On its own the effect does not send anything.

UFUNCTION(BlueprintCallable, Category = "Odin|Audio Pipeline|Effects")
static UOdinRestGSTTEffect* ConstructRestGSTTEffect(UObject* WorldContextObject);
ParameterTypeDescription
WorldContextObjectUObject*

Returns UOdinRestGSTTEffect*

PostRequest​

void PostRequest(const FString& Endpoint, const FString& Payload, const FString& ContentType);
ParameterTypeDescription
Endpointconst FString&
Payloadconst FString&
ContentTypeconst FString&

Remix​

bool Remix(
const float* InAudio,
int32 NumSamples,
int32 NumChannels,
int32 SourceSampleRate,
int32 TargetSampleRate,
Audio::FAlignedFloatBuffer& OutAudio);
ParameterTypeDescription
InAudioconst float*
NumSamplesint32
NumChannelsint32
SourceSampleRateint32
TargetSampleRateint32
OutAudioAudio::FAlignedFloatBuffer&

Returns bool

Properties​

SampleRate​

Blueprint: Get/Set

Sample rate of the incoming audio.

UPROPERTY(BlueprintReadWrite, Category = "Odin|Effects")
int32 SampleRate = 48000;

ResampleRate​

Blueprint: Get/Set

Sample rate the collected audio is resampled to.

UPROPERTY(BlueprintReadWrite, Category = "Odin|Effects")
int32 ResampleRate = 16000;

bStereo​

Blueprint: Get/Set

True if the incoming audio is interleaved stereo.

UPROPERTY(BlueprintReadWrite, Category = "Odin|Effects")
bool bStereo = false;

Timer​

Blueprint: Get/Set

Seconds of audio to collect before it is handed on.

UPROPERTY(BlueprintReadWrite, Category = "Odin|Effects")
float Timer = 3;

UserData​

TOdinCustomEffectUserData<UOdinRestGSTTEffect> UserData;

Events​

PostResponse​

Blueprint: Post Response (Generic STT Effect)

Raised with the body of the response when a request posted with PostRequest completes.

UPROPERTY(BlueprintAssignable, Category = "Odin|Events")
FOdinRestGSTTEffectResponse PostResponse;

Signature: FOdinRestGSTTEffectResponse void(FString response) (multicast)