Change with the including of libraries and copyright

This commit is contained in:
Respirant
2020-12-13 09:51:21 +01:00
parent f283f18041
commit daee6c62fc
11 changed files with 74 additions and 64 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

@@ -4,21 +4,37 @@
"VersionName": "1.0", "VersionName": "1.0",
"FriendlyName": "RuntimeAudioImporter", "FriendlyName": "RuntimeAudioImporter",
"Description": "Runtime Audio Importer plugin for Unreal Engine 4. Supports mp3, wav and flac formats.", "Description": "Runtime Audio Importer plugin for Unreal Engine 4. Supports mp3, wav and flac formats.",
"Category": "Audio", "Category": "Code Plugins",
"CreatedBy": "Respirant", "CreatedBy": "Respirant",
"CreatedByURL": "https://github.com/Respirant/RuntimeAudioImporter", "CreatedByURL": "https://github.com/Respirant/RuntimeAudioImporter",
"DocsURL": "https://github.com/Respirant/RuntimeAudioImporter", "DocsURL": "https://github.com/Respirant/RuntimeAudioImporter",
"MarketplaceURL": "", "MarketplaceURL": "com.epicgames.launcher://ue/marketplace/product/81fd278e318e4235a028d3fdf46bf036",
"SupportURL": "https://telegram.me/Respirant", "SupportURL": "https://telegram.me/Respirant",
"CanContainContent": false, "CanContainContent": false,
"IsBetaVersion": false, "IsBetaVersion": false,
"IsExperimentalVersion": false, "IsExperimentalVersion": false,
"Installed": true, "Installed": true,
"EngineVersion": "4.26.0",
"Modules": [ "Modules": [
{ {
"Name": "RuntimeAudioImporter", "Name": "RuntimeAudioImporter",
"Type": "Runtime", "Type": "Runtime",
"LoadingPhase": "Default" "LoadingPhase": "Default",
"WhitelistPlatforms": [
"Win64",
"Win32",
"Mac",
"Android",
"IOS",
"Linux"
],
"BlacklistPlatforms": [
"XboxOne",
"PS4",
"HTML5",
"TVOS",
"Switch"
]
} }
] ]
} }
@@ -1,4 +1,4 @@
// Copyright Epic Games, Inc. All Rights Reserved. // Respirant 2020.
#include "RuntimeAudioImporter.h" #include "RuntimeAudioImporter.h"
@@ -1,4 +1,4 @@
// Copyright Epic Games, Inc. All Rights Reserved. // Respirant 2020.
#include "RuntimeAudioImporterBPLibrary.h" #include "RuntimeAudioImporterBPLibrary.h"
#include "RuntimeAudioImporter.h" #include "RuntimeAudioImporter.h"
@@ -9,9 +9,6 @@ URuntimeAudioImporterBPLibrary::URuntimeAudioImporterBPLibrary(const FObjectInit
} }
/* Transcode audio file to USoundWave static object */ /* Transcode audio file to USoundWave static object */
class USoundWave* URuntimeAudioImporterBPLibrary::GetSoundWaveFromAudioFile(const FString& filePath, TEnumAsByte < AudioFormat > Format, TEnumAsByte < TranscodingStatus >& status, bool DefineFormatAutomatically) class USoundWave* URuntimeAudioImporterBPLibrary::GetSoundWaveFromAudioFile(const FString& filePath, TEnumAsByte < AudioFormat > Format, TEnumAsByte < TranscodingStatus >& status, bool DefineFormatAutomatically)
{ {
@@ -82,15 +79,11 @@ class USoundWave* URuntimeAudioImporterBPLibrary::GetSoundWaveObject(const uint8
return sw; return sw;
} }
#define DR_WAV_IMPLEMENTATION #include "ThirdParty/dr_wav.h"
#include "dr_libs/dr_wav.h"
#define DR_MP3_IMPLEMENTATION #include "ThirdParty/dr_mp3.h"
#include "dr_libs/dr_mp3.h"
#define DR_FLAC_IMPLEMENTATION
#include "dr_libs/dr_flac.h"
#include "ThirdParty/dr_flac.h"
/* Main internal get USoundWave from audio file */ /* Main internal get USoundWave from audio file */
class USoundWave* URuntimeAudioImporterBPLibrary::GetUSoundWaveFromAudioFile_Internal(const FString& filePath, TEnumAsByte < AudioFormat > Format, TEnumAsByte < TranscodingStatus >& status, bool DefineFormatAutomatically) class USoundWave* URuntimeAudioImporterBPLibrary::GetUSoundWaveFromAudioFile_Internal(const FString& filePath, TEnumAsByte < AudioFormat > Format, TEnumAsByte < TranscodingStatus >& status, bool DefineFormatAutomatically)
@@ -136,9 +129,8 @@ class USoundWave* URuntimeAudioImporterBPLibrary::GetUSoundWaveFromAudioFile_Int
return ReadyUSoundWave; return ReadyUSoundWave;
} }
/* Automatically get audio format. Internal use only recommended */ /* Automatically get audio format. Internal use only recommended */
TEnumAsByte<AudioFormat> URuntimeAudioImporterBPLibrary::GetAudioFormat(const FString & filePath) { TEnumAsByte<AudioFormat> URuntimeAudioImporterBPLibrary::GetAudioFormat(const FString& filePath) {
if (FPaths::GetExtension(filePath, false).Equals(TEXT("mp3"), ESearchCase::IgnoreCase)) { if (FPaths::GetExtension(filePath, false).Equals(TEXT("mp3"), ESearchCase::IgnoreCase)) {
return AudioFormat::MP3; return AudioFormat::MP3;
} }
@@ -154,7 +146,7 @@ TEnumAsByte<AudioFormat> URuntimeAudioImporterBPLibrary::GetAudioFormat(const FS
} }
/* Transcode Audio to Wave Data */ /* Transcode Audio to Wave Data */
bool URuntimeAudioImporterBPLibrary::TranscodeAudioToWaveData(const char* filePath, TEnumAsByte<AudioFormat> Format, TEnumAsByte<TranscodingStatus>& status, uint64& framesToWrite, int16_t*&pSampleData, uint32& channels, uint32& sampleRate) { bool URuntimeAudioImporterBPLibrary::TranscodeAudioToWaveData(const char* filePath, TEnumAsByte<AudioFormat> Format, TEnumAsByte<TranscodingStatus>& status, uint64& framesToWrite, int16_t*& pSampleData, uint32& channels, uint32& sampleRate) {
switch (Format) switch (Format)
{ {
case AudioFormat::MP3: case AudioFormat::MP3:
@@ -1,4 +1,4 @@
// Copyright Epic Games, Inc. All Rights Reserved. // Respirant 2020.
#pragma once #pragma once
@@ -1,4 +1,4 @@
// Copyright Epic Games, Inc. All Rights Reserved. // Respirant 2020.
#pragma once #pragma once
@@ -11,8 +11,6 @@
#include "RuntimeAudioImporterBPLibrary.generated.h" #include "RuntimeAudioImporterBPLibrary.generated.h"
UENUM(BlueprintType) UENUM(BlueprintType)
enum TranscodingStatus enum TranscodingStatus
{ {
@@ -30,7 +28,6 @@ enum TranscodingStatus
ZeroDurationError UMETA(DisplayName = "Transcoded audio has zero length") ZeroDurationError UMETA(DisplayName = "Transcoded audio has zero length")
}; };
UENUM(BlueprintType) UENUM(BlueprintType)
enum AudioFormat enum AudioFormat
{ {
@@ -40,7 +37,6 @@ enum AudioFormat
INVALID UMETA(DisplayName = "invalid (not defined format, internal use only)", Hidden) INVALID UMETA(DisplayName = "invalid (not defined format, internal use only)", Hidden)
}; };
UCLASS() UCLASS()
class RUNTIMEAUDIOIMPORTER_API URuntimeAudioImporterBPLibrary : public UBlueprintFunctionLibrary class RUNTIMEAUDIOIMPORTER_API URuntimeAudioImporterBPLibrary : public UBlueprintFunctionLibrary
{ {
@@ -1,53 +1,59 @@
// Some copyright should be here... // Respirant 2020.
using System;
using System.IO;
using UnrealBuildTool; using UnrealBuildTool;
public class RuntimeAudioImporter : ModuleRules public class RuntimeAudioImporter : ModuleRules
{ {
public RuntimeAudioImporter(ReadOnlyTargetRules Target) : base(Target) public RuntimeAudioImporter(ReadOnlyTargetRules Target) : base(Target)
{ {
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PublicIncludePaths.AddRange(
new string[] {
// ... add public include paths required here ...
}
);
PrivateIncludePaths.AddRange( PublicDefinitions.AddRange(
new string[] { new string[] {
"DR_WAV_IMPLEMENTATION=1",
"DR_MP3_IMPLEMENTATION=1",
"DR_FLAC_IMPLEMENTATION=1"
}
);
PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "ThirdParty"));
PrivateIncludePaths.AddRange(
new string[] {
// ... add other private include paths required here ... // ... add other private include paths required here ...
} }
); );
PublicDependencyModuleNames.AddRange( PublicDependencyModuleNames.AddRange(
new string[] new string[]
{ {
"Core", "Core",
// ... add other public dependencies that you statically link with here ... // ... add other public dependencies that you statically link with here ...
} }
); );
PrivateDependencyModuleNames.AddRange( PrivateDependencyModuleNames.AddRange(
new string[] new string[]
{ {
"CoreUObject", "CoreUObject",
"Engine", "Engine",
"Slate", "Slate",
"SlateCore", "SlateCore",
// ... add private dependencies that you statically link with here ... // ... add private dependencies that you statically link with here ...
} }
); );
DynamicallyLoadedModuleNames.AddRange( DynamicallyLoadedModuleNames.AddRange(
new string[] new string[]
{ {
// ... add any modules that your module loads dynamically here ... // ... add any modules that your module loads dynamically here ...
} }
); );
} }
} }
Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 87 KiB