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",
"FriendlyName": "RuntimeAudioImporter",
"Description": "Runtime Audio Importer plugin for Unreal Engine 4. Supports mp3, wav and flac formats.",
"Category": "Audio",
"Category": "Code Plugins",
"CreatedBy": "Respirant",
"CreatedByURL": "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",
"CanContainContent": false,
"IsBetaVersion": false,
"IsExperimentalVersion": false,
"Installed": true,
"EngineVersion": "4.26.0",
"Modules": [
{
"Name": "RuntimeAudioImporter",
"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"
@@ -1,4 +1,4 @@
// Copyright Epic Games, Inc. All Rights Reserved.
// Respirant 2020.
#include "RuntimeAudioImporterBPLibrary.h"
#include "RuntimeAudioImporter.h"
@@ -9,9 +9,6 @@ URuntimeAudioImporterBPLibrary::URuntimeAudioImporterBPLibrary(const FObjectInit
}
/* Transcode audio file to USoundWave static object */
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;
}
#define DR_WAV_IMPLEMENTATION
#include "dr_libs/dr_wav.h"
#include "ThirdParty/dr_wav.h"
#define DR_MP3_IMPLEMENTATION
#include "dr_libs/dr_mp3.h"
#define DR_FLAC_IMPLEMENTATION
#include "dr_libs/dr_flac.h"
#include "ThirdParty/dr_mp3.h"
#include "ThirdParty/dr_flac.h"
/* Main internal get USoundWave from audio file */
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;
}
/* 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)) {
return AudioFormat::MP3;
}
@@ -154,7 +146,7 @@ TEnumAsByte<AudioFormat> URuntimeAudioImporterBPLibrary::GetAudioFormat(const FS
}
/* 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)
{
case AudioFormat::MP3:
@@ -1,4 +1,4 @@
// Copyright Epic Games, Inc. All Rights Reserved.
// Respirant 2020.
#pragma once
@@ -1,4 +1,4 @@
// Copyright Epic Games, Inc. All Rights Reserved.
// Respirant 2020.
#pragma once
@@ -11,8 +11,6 @@
#include "RuntimeAudioImporterBPLibrary.generated.h"
UENUM(BlueprintType)
enum TranscodingStatus
{
@@ -30,7 +28,6 @@ enum TranscodingStatus
ZeroDurationError UMETA(DisplayName = "Transcoded audio has zero length")
};
UENUM(BlueprintType)
enum AudioFormat
{
@@ -40,7 +37,6 @@ enum AudioFormat
INVALID UMETA(DisplayName = "invalid (not defined format, internal use only)", Hidden)
};
UCLASS()
class RUNTIMEAUDIOIMPORTER_API URuntimeAudioImporterBPLibrary : public UBlueprintFunctionLibrary
{
@@ -1,53 +1,59 @@
// Some copyright should be here...
// Respirant 2020.
using System;
using System.IO;
using UnrealBuildTool;
public class RuntimeAudioImporter : ModuleRules
{
public RuntimeAudioImporter(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PublicIncludePaths.AddRange(
new string[] {
// ... add public include paths required here ...
}
);
PrivateIncludePaths.AddRange(
new string[] {
public RuntimeAudioImporter(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDefinitions.AddRange(
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 ...
}
);
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
);
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
// ... add other public dependencies that you statically link with here ...
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"CoreUObject",
"Engine",
"Slate",
"SlateCore",
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"CoreUObject",
"Engine",
"Slate",
"SlateCore",
// ... add private dependencies that you statically link with here ...
}
);
DynamicallyLoadedModuleNames.AddRange(
new string[]
{
);
DynamicallyLoadedModuleNames.AddRange(
new string[]
{
// ... 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