Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add adjustments for ARK's streamed SoundWaves #144

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions Unreal/UnSound.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ class USoundWave : public UObject // actual parent is USoundBase
DECLARE_CLASS(USoundWave, UObject);
public:
bool bStreaming;
#if ARK
bool bReallyUseStreamingReserved;
#endif
FByteBulkData RawData;
FGuid CompressedDataGuid;
TArray<FSoundFormatData> CompressedFormatData; // FFormatContainer in UE4
Expand All @@ -155,12 +158,18 @@ class USoundWave : public UObject // actual parent is USoundBase

USoundWave()
: bStreaming(false)
#if ARK
, bReallyUseStreamingReserved(false)
#endif
{}

BEGIN_PROP_TABLE
PROP_INT(NumChannels)
PROP_INT(SampleRate)
PROP_BOOL(bStreaming)
#if ARK
PROP_BOOL(bReallyUseStreamingReserved) // equivalent of bStreaming in ARK
#endif
PROP_DROP(bHasVirtualizeWhenSilent)
PROP_DROP(bVirtualizeWhenSilent)
PROP_DROP(Duration)
Expand All @@ -173,6 +182,13 @@ class USoundWave : public UObject // actual parent is USoundBase

Super::Serialize(Ar);

#if ARK
if (Ar.Game == GAME_Ark)
{
bStreaming = bReallyUseStreamingReserved;
}
#endif

bool bCooked;
Ar << bCooked;

Expand Down Expand Up @@ -200,6 +216,14 @@ class USoundWave : public UObject // actual parent is USoundBase

if (bStreaming)
{
#if ARK
if (Ar.Game == GAME_Ark)
{
// another bCooked. this one is relevant for streaming.
// if negative, there's no data after it, but that won't happen with client assets.
Ar << bCooked;
}
#endif
int32 NumChunks;
FName AudioFormat;
Ar << NumChunks << StreamedFormat;
Expand Down