Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #218 from lucoiso/development
Browse files Browse the repository at this point in the history
clear empty lines + add include
  • Loading branch information
lucoiso authored Jun 20, 2023
2 parents c6d06f1 + 4f90ec1 commit 1359429
Show file tree
Hide file tree
Showing 24 changed files with 58 additions and 58 deletions.
2 changes: 1 addition & 1 deletion Source/AzSpeech/AzSpeech.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ public AzSpeech(ReadOnlyTargetRules Target) : base(Target)

PrivateIncludePathModuleNames.Add("DesktopPlatform");
}
}
}
1 change: 1 addition & 0 deletions Source/AzSpeech/Private/AzSpeech/AzSpeechHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <Serialization/JsonReader.h>
#include <Serialization/JsonSerializer.h>
#include <Dom/JsonObject.h>
#include <Misc/PackageName.h>

#if WITH_EDITORONLY_DATA
#include <EditorFramework/AssetImportData.h>
Expand Down
34 changes: 17 additions & 17 deletions Source/AzSpeech/Public/AzSpeech/AzSpeechHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ class AZSPEECH_API UAzSpeechHelper final : public UBlueprintFunctionLibrary
return QualifyFileExtension(Path, Name, "xml");
}

/*
/*
Convert .wav file to USoundWave.
[OutputModule, RelativeOutputDirectory, OutputAssetName]: Used to save the generated audio data in project's content. Set empty values to generate a transient Sound Wave
OutputModule: Name of the module that will be used to save the generated audio data in project's content. Example: Game.
OutputModule: Name of the module that will be used to save the generated audio data in project's content. Example: Game.
RelativeOutputDirectory: Directory where the sound wave will be saved
OutputAssetName: Name of the generated Sound Wave
Expand All @@ -60,12 +60,12 @@ class AZSPEECH_API UAzSpeechHelper final : public UBlueprintFunctionLibrary
UFUNCTION(BlueprintCallable, Category = "AzSpeech | Audio", Meta = (DisplayName = "Convert .wav file to USoundWave"))
static USoundWave* ConvertWavFileToSoundWave(const FString& FilePath, const FString& FileName, const FString& OutputModule = "", const FString& RelativeOutputDirectory = "", const FString& OutputAssetName = "");

/*
/*
Convert audio data (TArray<uint8>) to USoundWave.
[OutputModule, RelativeOutputDirectory, OutputAssetName]: Used to save the generated audio data in project's content. Set empty values to generate a transient Sound Wave
OutputModule: Name of the module that will be used to save the generated audio data in project's content. Example: Game.
OutputModule: Name of the module that will be used to save the generated audio data in project's content. Example: Game.
RelativeOutputDirectory: Directory where the sound wave will be saved
OutputAssetName: Name of the generated Sound Wave
Expand Down Expand Up @@ -117,7 +117,7 @@ class AZSPEECH_API UAzSpeechHelper final : public UBlueprintFunctionLibrary
/* Check if the content module is available */
UFUNCTION(BlueprintPure, Category = "AzSpeech | Utils")
static const bool IsContentModuleAvailable(const FString& ModuleName);

/* Get AzSpeech Friendly Name */
UFUNCTION(BlueprintPure, Category = "AzSpeech | Utils")
static const FString GetPluginFriendlyName();
Expand All @@ -126,28 +126,28 @@ class AZSPEECH_API UAzSpeechHelper final : public UBlueprintFunctionLibrary
UFUNCTION(BlueprintPure, Category = "AzSpeech | Utils")
static const FString GetPluginVersion();

/*
/*
Extract the Animation JSON property from Viseme Data.
JSON Body Format:
[
FrameIndex: Integer,
BlendShapes: [
[
Number,
...
],
[
Number,
...
],
...
BlendShapes: [
[
Number,
...
],
[
Number,
...
],
...
]
]
*/
UFUNCTION(BlueprintPure, Category = "AzSpeech | Data")
static const FAzSpeechAnimationData ExtractAnimationDataFromVisemeData(const FAzSpeechVisemeData& VisemeData);

/*
Extract the Animation JSON property from Viseme Data Array.
Expand Down
8 changes: 4 additions & 4 deletions Source/AzSpeech/Public/AzSpeech/AzSpeechSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "AzSpeechSettings.generated.h"

/**
*
*
*/
UCLASS(Config = Plugins, DefaultConfig, meta = (DisplayName="AzSpeech"))
class AZSPEECH_API UAzSpeechSettings final : public UDeveloperSettings
Expand All @@ -37,8 +37,8 @@ class AZSPEECH_API UAzSpeechSettings final : public UDeveloperSettings

/* Thread update interval: Sleep time between task update checks */
UPROPERTY(GlobalConfig, EditAnywhere, Category = "Thread", Meta = (DisplayName = "Thread Update Interval", ClampMin = "0.0001", UIMin = "0.0001", ClampMax = "1", UIMax = "1"))
float ThreadUpdateInterval;
float ThreadUpdateInterval;

/* If enabled, SSML synthesizers tasks with viseme output type set to FacialExpression will return only data that contains the Animation property */
UPROPERTY(GlobalConfig, EditAnywhere, Category = "Information", Meta = (DisplayName = "Filter Viseme Facial Expression"))
bool bFilterVisemeFacialExpression;
Expand All @@ -54,7 +54,7 @@ class AZSPEECH_API UAzSpeechSettings final : public UDeveloperSettings
/* Will print extra debugging informations in log */
UPROPERTY(GlobalConfig, EditAnywhere, Category = "Information", Meta = (DisplayName = "Enable Debugging Logs"))
bool bEnableDebuggingLogs;

/* Will print extra debugging informations in screen */
UPROPERTY(GlobalConfig, EditAnywhere, Category = "Information", Meta = (DisplayName = "Enable Debugging Prints"))
bool bEnableDebuggingPrints;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ THIRD_PARTY_INCLUDES_END
/**
*
*/

class FAzSpeechRecognitionRunnable : public FAzSpeechRunnableBase
{
{
public:
FAzSpeechRecognitionRunnable() = delete;
FAzSpeechRecognitionRunnable(UAzSpeechTaskBase* InOwningTask, const std::shared_ptr<Microsoft::CognitiveServices::Speech::Audio::AudioConfig>& InAudioConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct AZSPEECH_API FAzSpeechBlendShapes
GENERATED_BODY()

FAzSpeechBlendShapes() = default;

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "AzSpeech")
TArray<float> Data;
};
Expand All @@ -22,12 +22,12 @@ USTRUCT(BlueprintType, Category = "AzSpeech")
struct AZSPEECH_API FAzSpeechAnimationData
{
GENERATED_BODY()

FAzSpeechAnimationData() = default;

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "AzSpeech")
int32 FrameIndex = 0;

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "AzSpeech")
TArray<FAzSpeechBlendShapes> BlendShapes;
};
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct AZSPEECH_API FAzSpeechAudioInputDeviceInfo

return Output;
}

const FString GetAudioInputDeviceEndpointID() const
{
// {0.0.1.00000000}.{Device ID}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ USTRUCT(BlueprintType, Category = "AzSpeech")
struct AZSPEECH_API FAzSpeechRecognitionData
{
GENERATED_BODY()

FAzSpeechRecognitionData() : Value(0), Weight(1) {};
FAzSpeechRecognitionData(const int32 InValue) : Value(InValue) {};
FAzSpeechRecognitionData(const int32 InValue, const int32 InWeight) : Value(InValue), Weight(InWeight) {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ struct AZSPEECH_API FAzSpeechRecognitionOptions
void SetDefaults();
};


USTRUCT(BlueprintType, Category = "AzSpeech")
struct AZSPEECH_API FAzSpeechSynthesisOptions
{
Expand Down Expand Up @@ -167,16 +166,16 @@ USTRUCT(BlueprintType, Category = "AzSpeech")
struct AZSPEECH_API FAzSpeechSettingsOptions
{
GENERATED_BODY()

public:
FAzSpeechSettingsOptions();

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Azure", Meta = (DisplayName = "Subscription Options"))
FAzSpeechSubscriptionOptions SubscriptionOptions;

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Azure", Meta = (DisplayName = "Recognition Options"))
FAzSpeechRecognitionOptions RecognitionOptions;

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Azure", Meta = (DisplayName = "Synthesis Options"))
FAzSpeechSynthesisOptions SynthesisOptions;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ UCLASS(Abstract, NotPlaceable, Category = "AzSpeech", meta = (ExposedAsyncProxy
class AZSPEECH_API UAzSpeechAudioDataSynthesisBase : public UAzSpeechSynthesizerTaskBase
{
GENERATED_BODY()

protected:
virtual bool StartAzureTaskWork() override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class AZSPEECH_API UAzSpeechRecognizerTaskBase : public UAzSpeechTaskBase
GENERATED_BODY()

friend class FAzSpeechRecognitionRunnable;
public:

public:
/* Task delegate that will be called when completed */
UPROPERTY(BlueprintAssignable, Category = "AzSpeech")
FRecognitionCompletedDelegate RecognitionCompleted;
Expand Down Expand Up @@ -55,11 +55,11 @@ class AZSPEECH_API UAzSpeechRecognizerTaskBase : public UAzSpeechTaskBase

UFUNCTION(BlueprintPure, Category = "AzSpeech")
const int32 GetRecognitionLatency() const;

protected:
FName PhraseListGroup = NAME_None;
FAzSpeechRecognitionOptions RecognitionOptions;

void StartRecognitionWork(const std::shared_ptr<Microsoft::CognitiveServices::Speech::Audio::AudioConfig>& InAudioConfig);

virtual void BroadcastFinalResult() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class AZSPEECH_API UAzSpeechSpeechSynthesisBase : public UAzSpeechAudioDataSynth

UFUNCTION()
void OnAudioPlayStateChanged(const EAudioComponentPlayState PlayState);

private:
TWeakObjectPtr<class UAudioComponent> AudioComponent;
};
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class AZSPEECH_API UAzSpeechSynthesizerTaskBase : public UAzSpeechTaskBase

friend class FAzSpeechSynthesisRunnable;

public:
public:
/* Task delegate that will be called when dpdated */
UPROPERTY(BlueprintAssignable, Category = "AzSpeech")
FAzSpeechTaskGenericDelegate SynthesisUpdated;
Expand Down Expand Up @@ -96,16 +96,16 @@ class AZSPEECH_API UAzSpeechSynthesizerTaskBase : public UAzSpeechTaskBase

UFUNCTION(BlueprintPure, Category = "AzSpeech")
const int32 GetServiceLatency() const;

protected:
FString SynthesisText;
FAzSpeechSynthesisOptions SynthesisOptions;

void StartSynthesisWork(const std::shared_ptr<Microsoft::CognitiveServices::Speech::Audio::AudioConfig>& InAudioConfig);

virtual void OnVisemeReceived(const FAzSpeechVisemeData& VisemeData);
virtual void OnSynthesisUpdate(const std::shared_ptr<Microsoft::CognitiveServices::Speech::SpeechSynthesisResult>& LastResult);

private:
std::vector<uint8_t> AudioData;
TArray<FAzSpeechVisemeData> VisemeDataArray;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class AZSPEECH_API UAzSpeechTaskStatus final : public UBlueprintFunctionLibrary
static bool IsTaskActive(const UAzSpeechTaskBase* Test);

UFUNCTION(BlueprintPure, Category = "AzSpeech")
static bool IsTaskReadyToDestroy(const UAzSpeechTaskBase* Test);
static bool IsTaskReadyToDestroy(const UAzSpeechTaskBase* Test);

UFUNCTION(BlueprintPure, Category = "AzSpeech")
static bool IsTaskStillValid(const UAzSpeechTaskBase* Test);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class AZSPEECH_API UAzSpeechWavFileSynthesisBase : public UAzSpeechSynthesizerTa
/* Task delegate that will be called when completed */
UPROPERTY(BlueprintAssignable, Category = "AzSpeech")
FBooleanSynthesisDelegate SynthesisCompleted;
virtual void Activate() override;

virtual void Activate() override;
virtual void SetReadyToDestroy() override;

protected:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class AZSPEECH_API URecognitionMapCheckAsync : public UBlueprintAsyncActionBase
void BroadcastResult(const int32 Result);
const int32 CheckRecognitionResult() const;
const bool CheckStringContains(const FString& KeyType, const FString& Key) const;

const FName GetStringDelimiters() const;
const bool CheckStringDelimiters(const int32 Index) const;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class AZSPEECH_API USSMLToAudioDataAsync : public UAzSpeechAudioDataSynthesisBas
/* Creates a SSML-To-AudioData task that will convert your SSML file to a audio data */
UFUNCTION(BlueprintCallable, Category = "AzSpeech | Custom", meta = (BlueprintInternalUseOnly = "true", WorldContext = "WorldContextObject", DisplayName = "SSML To Audio Data with Custom Options"))
static USSMLToAudioDataAsync* SSMLToAudioData_CustomOptions(UObject* WorldContextObject, const FAzSpeechSubscriptionOptions SubscriptionOptions, const FAzSpeechSynthesisOptions SynthesisOptions, const FString& SynthesisSSML);

protected:
virtual void BroadcastFinalResult() override;
};
4 changes: 2 additions & 2 deletions Source/AzSpeech/Public/AzSpeech/Tasks/SpeechToTextAsync.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ class AZSPEECH_API USpeechToTextAsync : public UAzSpeechRecognizerTaskBase
static USpeechToTextAsync* SpeechToText_CustomOptions(UObject* WorldContextObject, const FAzSpeechSubscriptionOptions SubscriptionOptions, const FAzSpeechRecognitionOptions RecognitionOptions, const FString& AudioInputDeviceID = "Default", const FName PhraseListGroup = NAME_None);

virtual void Activate() override;

UFUNCTION(BlueprintPure, Category = "AzSpeech")
bool IsUsingDefaultAudioInputDevice() const;

protected:
virtual bool StartAzureTaskWork() override;

private:
FString AudioInputDeviceID;
};
2 changes: 1 addition & 1 deletion Source/AzSpeech/Public/AzSpeech/Tasks/WavFileToTextAsync.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class AZSPEECH_API UWavFileToTextAsync : public UAzSpeechRecognizerTaskBase

protected:
virtual bool StartAzureTaskWork() override;

private:
FString FilePath;
FString FileName;
Expand Down
2 changes: 1 addition & 1 deletion Source/AzSpeechEditor/AzSpeechEditor.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ public AzSpeechEditor(ReadOnlyTargetRules Target) : base(Target)
"WorkspaceMenuStructure"
});
}
}
}
4 changes: 2 additions & 2 deletions Source/AzSpeechEditor/Private/AzSpeechEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void FAzSpeechEditorModule::RegisterMenus()
#endif

const TSharedPtr<FWorkspaceItem> Menu = WorkspaceMenu::GetMenuStructure().GetToolsCategory()->AddGroup(LOCTEXT("AzSpeechCategory", "AzSpeech"), LOCTEXT("AzSpeechCategoryTooltip", "AzSpeech Plugin Tabs"), FSlateIcon(AppStyleName, "Icons.Package"));

FGlobalTabmanager::Get()->RegisterNomadTabSpawner(AzSpeechEditorTabName, EditorTabSpawnerDelegate)
.SetDisplayName(FText::FromString("AzSpeech Audio Generator"))
.SetTooltipText(FText::FromString("Open AzSpeech Audio Generator"))
Expand All @@ -57,5 +57,5 @@ void FAzSpeechEditorModule::RegisterMenus()
}

#undef LOCTEXT_NAMESPACE

IMPLEMENT_MODULE(FAzSpeechEditorModule, AzSpeechEditor)
2 changes: 1 addition & 1 deletion Source/AzSpeechEditor/Private/SAzSpeechAudioGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,4 +335,4 @@ void SAzSpeechAudioGenerator::OnFileInfoCommited(const FText& InText, FString& M
Member = FPaths::MakeValidFileName(NewValue);

InputRef->SetText(FText::FromString(Member));
}
}
2 changes: 1 addition & 1 deletion Source/AzSpeechEditor/Private/SAzSpeechAudioGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class UAzSpeechPropertiesGetter : public UObject

public:
explicit UAzSpeechPropertiesGetter(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get());

FAvailableVoicesUpdated OnAvailableVoicesUpdated;
FAudioDataGenerated OnAudioDataGenerated;

Expand Down
2 changes: 1 addition & 1 deletion Source/ThirdParty/AzureWrapper/AzureWrapper.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,4 +255,4 @@ public AzureWrapper(ReadOnlyTargetRules Target) : base(Target)
AdditionalPropertiesForReceipt.Add("AndroidPlugin", Path.Combine(ModuleDirectory, "AzSpeech_UPL_Android.xml"));
}
}
}
}

0 comments on commit 1359429

Please sign in to comment.