Skip to content

Commit

Permalink
update to Odin Unreal SDK Version 1.5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
SFuhrmann committed Jun 23, 2023
1 parent 9b0e419 commit 9be98f1
Show file tree
Hide file tree
Showing 38 changed files with 1,282 additions and 408 deletions.
Binary file modified Content/Maps/Lobby.umap
Binary file not shown.
Binary file modified Content/Maps/TopDownExampleMap.umap
Binary file not shown.
8 changes: 4 additions & 4 deletions Plugins/Odin/Odin.uplugin
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"FileVersion": 2,
"Version": 1,
"EngineVersion": "4.26.0",
"WhitelistPlatforms": [ "Win64", "Mac", "Linux", "Android" ],
"VersionName": "1.3.3",
"WhitelistPlatforms": [ "Win64", "Mac", "IOS", "Linux", "Android" ],
"VersionName": "1.5.5",
"FriendlyName": "4Players ODIN",
"Description": "Unreal integration plugin to integrate real-time chat technology into your game",
"Category": "Other",
Expand All @@ -21,7 +21,7 @@
"Name": "Odin",
"Type": "Runtime",
"LoadingPhase": "PostConfigInit",
"WhitelistPlatforms": [ "Win64", "Mac", "Linux", "Android" ],
"WhitelistPlatforms": [ "Win64", "Mac", "IOS", "Linux", "Android" ],
"AdditionalDependencies": [
"AudioMixer",
"AudioCapture"
Expand All @@ -32,7 +32,7 @@
{
"Name": "AudioCapture",
"Enabled": true,
"WhitelistPlatforms": [ "Win64", "Mac", "Linux", "Android" ]
"WhitelistPlatforms": [ "Win64", "Mac", "IOS", "Linux", "Android" ]
}
]
}
31 changes: 19 additions & 12 deletions Plugins/Odin/Source/Odin/Odin.Build.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2022 4Players GmbH. All rights reserved. */
/* Copyright (c) 2022-2023 4Players GmbH. All rights reserved. */

using System.IO;

Expand All @@ -9,25 +9,32 @@ public class Odin : ModuleRules
public Odin(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PrecompileForTargets = PrecompileTargetsType.Any;

// List of all paths to include files that are exposed to other modules
PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Public"));

// List of all paths to this module's internal include files, not exposed to other modules
PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "Private"));

// Enable warnings for using undefined identifiers in #if expressions
bEnableUndefinedIdentifierWarnings = false;

// List of public dependency module names
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
"CoreUObject",
"Engine",
"AudioMixer",
"SignalProcessing",
"AudioCapture",
"Json",
"JsonUtilities",
"OdinLibrary",
"Projects",
"Core",
"CoreUObject",
"Engine",
"AudioMixer",
"SignalProcessing",
"AudioCapture",
"Json",
"JsonUtilities",
"OdinLibrary",
"Projects", "AudioCaptureCore",
}
);
);
}
}
30 changes: 20 additions & 10 deletions Plugins/Odin/Source/Odin/Private/Odin.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2022 4Players GmbH. All rights reserved. */
/* Copyright (c) 2022-2023 4Players GmbH. All rights reserved. */

#include "Odin.h"
#include "CoreMinimal.h"
Expand All @@ -7,10 +7,14 @@
#include "Misc/Paths.h"
#include "Modules/ModuleManager.h"

#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_IOS || PLATFORM_LINUX
#include "HAL/PlatformProcess.h"
#endif

#if PLATFORM_IOS
#include "IOSAppDelegate.h"
#endif

#include "OdinCore/include/odin.h"

#define LOCTEXT_NAMESPACE "FOdinModule"
Expand All @@ -19,13 +23,18 @@ DEFINE_LOG_CATEGORY(Odin)

void FOdinModule::StartupModule()
{
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
#if PLATFORM_IOS
[[IOSAppDelegate GetDelegate] SetFeature:EAudioFeature::Playback Active:true];
[[IOSAppDelegate GetDelegate] SetFeature:EAudioFeature::Record Active:true];
[[IOSAppDelegate GetDelegate] SetFeature:EAudioFeature::VoiceChat Active:true];
#endif

#if PLATFORM_WINDOWS || PLATFORM_LINUX
FString BaseDir = IPluginManager::Get().FindPlugin("Odin")->GetBaseDir();
FString LibraryPath;
FString libraryName;

FString PlatformArchitecture;

#if PLATFORM_CPU_X86_FAMILY
PlatformArchitecture = "x64";
#elif PLATFORM_CPU_ARM_FAMILY
Expand All @@ -40,10 +49,6 @@ void FOdinModule::StartupModule()
LibraryPath =
FPaths::Combine(*BaseDir, TEXT("Source/OdinCore"), PlatformArchitecture, TEXT("Linux"));
libraryName = "libodin.so";
#elif PLATFORM_MAC
LibraryPath =
FPaths::Combine(*BaseDir, TEXT("Source/OdinCore"), PlatformArchitecture, TEXT("Mac"));
libraryName = "libodin.dylib";
#endif

FPlatformProcess::PushDllDirectory(*LibraryPath);
Expand All @@ -58,14 +63,19 @@ void FOdinModule::StartupModule()
UE_LOG(Odin, Log, TEXT("Loaded Library (%s)"), *(LibraryPath / libraryName));
}
#endif
odin_startup(ODIN_VERSION);

auto sample_rate = 48000;
auto channel_count = 2;

odin_startup_ex(ODIN_VERSION,
OdinAudioStreamConfig{(uint32_t)sample_rate, (uint8_t)channel_count});
}

void FOdinModule::ShutdownModule()
{
odin_shutdown();

#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
#if PLATFORM_WINDOWS || PLATFORM_LINUX
FPlatformProcess::FreeDllHandle(OdinLibraryHandle);
OdinLibraryHandle = nullptr;
#endif
Expand Down
Loading

0 comments on commit 9be98f1

Please sign in to comment.