From 8a93149510f5c49c6e1f383a70b22af78cdf47f3 Mon Sep 17 00:00:00 2001 From: getnamo Date: Thu, 12 Sep 2019 01:14:43 -0700 Subject: [PATCH] 1.1.0 release --- SocketIOClient.uplugin | 4 ++-- .../CoreUtility/Private/CoreUtilityBPLibrary.cpp | 16 +++++++--------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/SocketIOClient.uplugin b/SocketIOClient.uplugin index 6edb6b13..e60f2ad3 100644 --- a/SocketIOClient.uplugin +++ b/SocketIOClient.uplugin @@ -1,8 +1,8 @@ { "FileVersion": 3, "Version": 1, - "VersionName": "1.0.26", - "EngineVersion" : "4.22.0", + "VersionName": "1.1.0", + "EngineVersion" : "4.23.0", "FriendlyName": "Socket.IO Client", "Description": "Real-time networking library Socket.IO Client usable from blueprints and c++.", "Category": "Networking", diff --git a/Source/CoreUtility/Private/CoreUtilityBPLibrary.cpp b/Source/CoreUtility/Private/CoreUtilityBPLibrary.cpp index 02362278..62a8580f 100644 --- a/Source/CoreUtility/Private/CoreUtilityBPLibrary.cpp +++ b/Source/CoreUtility/Private/CoreUtilityBPLibrary.cpp @@ -105,6 +105,12 @@ TSharedPtr OpusCoder; TArray UCoreUtilityBPLibrary::Conv_OpusBytesToWav(const TArray& InBytes) { + TArray WavBytes; + //Early exit condition + if (InBytes.Num() == 0) + { + return WavBytes; + } if (!OpusCoder) { OpusCoder = MakeShareable(new FOpusCoder()); @@ -116,7 +122,7 @@ TArray UCoreUtilityBPLibrary::Conv_OpusBytesToWav(const TArray& In OpusCoder->DeserializeMinimal(InBytes, OpusBytes, CompressedFrameSizes); OpusCoder->DecodeStream(OpusBytes, CompressedFrameSizes, PCMBytes); - TArray WavBytes; + SerializeWaveFile(WavBytes, PCMBytes.GetData(), PCMBytes.Num(), OpusCoder->Channels, OpusCoder->SampleRate); return WavBytes; @@ -148,14 +154,6 @@ TArray UCoreUtilityBPLibrary::Conv_WavBytesToOpus(const TArray& In TArray SerializedBytes; OpusCoder->SerializeMinimal(OpusBytes, CompressedFrameSizes, SerializedBytes); - //test decoding the stream again - /*PCMBytes.Empty(); - OpusCoder->DecodeStream(OpusBytes, CompressedFrameSizes, PCMBytes); - - TArray WavBytes; - SerializeWaveFile(WavBytes, PCMBytes.GetData(), PCMBytes.Num(), OpusCoder->Channels, OpusCoder->SampleRate);*/ - - //try to test a re-encode return SerializedBytes; }