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 #224 from lucoiso/development
Browse files Browse the repository at this point in the history
AzSpeech v1.6.11
  • Loading branch information
lucoiso authored Aug 15, 2023
2 parents c136f24 + d900efe commit 357086b
Show file tree
Hide file tree
Showing 12 changed files with 414 additions and 404 deletions.
4 changes: 2 additions & 2 deletions AzSpeech.uplugin
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"FileVersion": 3,
"Version": 27,
"VersionName": "1.6.10",
"Version": 28,
"VersionName": "1.6.11",
"FriendlyName": "AzSpeech - Voice and Text",
"Description": "Integrates Azure Speech Cognitive Services into the Engine by adding functions to perform recognition and synthesis via asynchronous tasks.",
"Category": "Game Features",
Expand Down
2 changes: 1 addition & 1 deletion Source/AzSpeech/Private/AzSpeech.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ void FAzSpeechModule::StartupModule()
#endif

#if WITH_EDITOR && !AZSPEECH_SUPPORTED_PLATFORM
FMessageDialog::Open(EAppMsgType::Ok, FText::FromString("Currently, AzSpeech does not officially support the platform you're using/targeting. If you encounter any issue and can/want to contribute, get in touch! :)\n\nRepository Link: github.com/lucoiso/UEAzSpeech"));
FMessageDialog::Open(EAppMsgType::Ok, FText::FromString(TEXT("Currently, AzSpeech does not officially support the platform you're using/targeting. If you encounter any issue and can/want to contribute, get in touch! :)\n\nRepository Link: github.com/lucoiso/UEAzSpeech")));
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion Source/AzSpeech/Private/AzSpeech/AzSpeechHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ const FAzSpeechAnimationData UAzSpeechHelper::ExtractAnimationDataFromVisemeData
}

const TSharedRef<TJsonReader<>> Reader = TJsonReaderFactory<>::Create(VisemeData.Animation);
TSharedPtr<FJsonObject> JsonObject = MakeShareable(new FJsonObject);
TSharedPtr<FJsonObject> JsonObject = MakeShared<FJsonObject>();
FJsonSerializer::Deserialize(Reader, JsonObject);

if (!JsonObject.IsValid())
Expand Down
2 changes: 1 addition & 1 deletion Source/AzSpeech/Private/AzSpeech/AzSpeechSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void UAzSpeechSettings::PostEditChangeProperty(FPropertyChangedEvent& PropertyCh

if (DefaultOptions.RecognitionOptions.CandidateLanguages.Num() > MaxCandidateLanguages)
{
FMessageDialog::Open(EAppMsgType::Ok, FText::FromString("You can only include up to 4 languages for at-start LID and up to 10 languages for continuous LID."));
FMessageDialog::Open(EAppMsgType::Ok, FText::FromString(TEXT("You can only include up to 4 languages for at-start LID and up to 10 languages for continuous LID.")));
DefaultOptions.RecognitionOptions.CandidateLanguages.RemoveAtSwap(MaxCandidateLanguages, DefaultOptions.RecognitionOptions.CandidateLanguages.Num() - MaxCandidateLanguages, true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ THIRD_PARTY_INCLUDES_END
/**
*
*/
class FAzSpeechRecognitionRunnable : public FAzSpeechRunnableBase
class FAzSpeechRecognitionRunnable : public FAzSpeechRunnableBase
{
public:
FAzSpeechRecognitionRunnable() = delete;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ THIRD_PARTY_INCLUDES_END
/**
*
*/
class FAzSpeechSynthesisRunnable : public FAzSpeechRunnableBase
class FAzSpeechSynthesisRunnable : public FAzSpeechRunnableBase
{
public:
FAzSpeechSynthesisRunnable() = delete;
Expand Down
6 changes: 3 additions & 3 deletions Source/AzSpeechEditor/Private/AzSpeechEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Repo: https://github.com/lucoiso/UEAzSpeech

#include "AzSpeechEditor.h"
#include "SAzSpeechAudioGenerator.h"
#include "Generator/SAzSpeechAudioGenerator.h"
#include <ToolMenus.h>
#include <Widgets/Docking/SDockTab.h>
#include <WorkspaceMenuStructure.h>
Expand Down Expand Up @@ -50,8 +50,8 @@ void FAzSpeechEditorModule::RegisterMenus()
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"))
.SetDisplayName(FText::FromString(TEXT("AzSpeech Audio Generator")))
.SetTooltipText(FText::FromString(TEXT("Open AzSpeech Audio Generator")))
.SetIcon(FSlateIcon(AppStyleName, "Icons.Plus"))
.SetGroup(Menu.ToSharedRef());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Author: Lucas Vilas-Boas
// Year: 2023
// Repo: https://github.com/lucoiso/UEAzSpeech

#include "AzSpeechPropertiesGetter.h"

#ifdef UE_INLINE_GENERATED_CPP_BY_NAME
#include UE_INLINE_GENERATED_CPP_BY_NAME(AzSpeechPropertiesGetter)
#endif

UAzSpeechPropertiesGetter::UAzSpeechPropertiesGetter(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
}

void UAzSpeechPropertiesGetter::OnAvailableVoicesChanged(const TArray<FString>& Voices)
{
OnAvailableVoicesUpdated.ExecuteIfBound(Voices);
Destroy();
}

void UAzSpeechPropertiesGetter::SynthesisCompleted(const TArray<uint8>& AudioData)
{
OnAudioDataGenerated.ExecuteIfBound(AudioData);
Destroy();
}

void UAzSpeechPropertiesGetter::TaskFail()
{
Destroy();
}

void UAzSpeechPropertiesGetter::Destroy()
{
ClearFlags(RF_Standalone);

#if ENGINE_MAJOR_VERSION >= 5
MarkAsGarbage();
#else
MarkPendingKill();
#endif
}
35 changes: 35 additions & 0 deletions Source/AzSpeechEditor/Private/Generator/AzSpeechPropertiesGetter.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Author: Lucas Vilas-Boas
// Year: 2023
// Repo: https://github.com/lucoiso/UEAzSpeech

#pragma once

#include <CoreMinimal.h>
#include <UObject/Object.h>
#include "AzSpeechPropertiesGetter.generated.h"

DECLARE_DELEGATE_OneParam(FAvailableVoicesUpdated, TArray<FString>);
DECLARE_DELEGATE_OneParam(FAudioDataGenerated, TArray<uint8>);

UCLASS(MinimalAPI, NotBlueprintable, NotPlaceable, Category = "Implementation")
class UAzSpeechPropertiesGetter : public UObject
{
GENERATED_BODY()

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

FAvailableVoicesUpdated OnAvailableVoicesUpdated;
FAudioDataGenerated OnAudioDataGenerated;

UFUNCTION()
void OnAvailableVoicesChanged(const TArray<FString>& Voices);

UFUNCTION()
void SynthesisCompleted(const TArray<uint8>& AudioData);

UFUNCTION()
void TaskFail();

void Destroy();
};
Loading

0 comments on commit 357086b

Please sign in to comment.