Skip to content

Commit

Permalink
1.1.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
getnamo committed Sep 12, 2019
1 parent 665e4b2 commit 8a93149
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
4 changes: 2 additions & 2 deletions SocketIOClient.uplugin
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
16 changes: 7 additions & 9 deletions Source/CoreUtility/Private/CoreUtilityBPLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ TSharedPtr<FOpusCoder> OpusCoder;

TArray<uint8> UCoreUtilityBPLibrary::Conv_OpusBytesToWav(const TArray<uint8>& InBytes)
{
TArray<uint8> WavBytes;
//Early exit condition
if (InBytes.Num() == 0)
{
return WavBytes;
}
if (!OpusCoder)
{
OpusCoder = MakeShareable(new FOpusCoder());
Expand All @@ -116,7 +122,7 @@ TArray<uint8> UCoreUtilityBPLibrary::Conv_OpusBytesToWav(const TArray<uint8>& In
OpusCoder->DeserializeMinimal(InBytes, OpusBytes, CompressedFrameSizes);
OpusCoder->DecodeStream(OpusBytes, CompressedFrameSizes, PCMBytes);

TArray<uint8> WavBytes;

SerializeWaveFile(WavBytes, PCMBytes.GetData(), PCMBytes.Num(), OpusCoder->Channels, OpusCoder->SampleRate);

return WavBytes;
Expand Down Expand Up @@ -148,14 +154,6 @@ TArray<uint8> UCoreUtilityBPLibrary::Conv_WavBytesToOpus(const TArray<uint8>& In
TArray<uint8> SerializedBytes;
OpusCoder->SerializeMinimal(OpusBytes, CompressedFrameSizes, SerializedBytes);

//test decoding the stream again
/*PCMBytes.Empty();
OpusCoder->DecodeStream(OpusBytes, CompressedFrameSizes, PCMBytes);
TArray<uint8> WavBytes;
SerializeWaveFile(WavBytes, PCMBytes.GetData(), PCMBytes.Num(), OpusCoder->Channels, OpusCoder->SampleRate);*/

//try to test a re-encode
return SerializedBytes;
}

Expand Down

0 comments on commit 8a93149

Please sign in to comment.