mirror of
https://github.com/4sval/FModel.git
synced 2026-03-21 17:24:26 -05:00
Wwise media assets + .adx fallback
This commit is contained in:
parent
40996973eb
commit
508dcb4c7a
|
|
@ -1 +1 @@
|
|||
Subproject commit 4935ec79a1d2c801b0735d84cb42322475231359
|
||||
Subproject commit ad9836e6bc106bedfd525d1a63c46e297f42388c
|
||||
|
|
@ -617,6 +617,16 @@ public class AudioPlayerViewModel : ViewModel, ISource, IDisposable
|
|||
_ => throw new NotSupportedException()
|
||||
};
|
||||
|
||||
if (wavData.Length is 0)
|
||||
{
|
||||
if (TryConvert(out var wavFilePathFallback))
|
||||
{
|
||||
var newAudioFallback = new AudioFile(SelectedAudioFile.Id, new FileInfo(wavFilePathFallback));
|
||||
Replace(newAudioFallback);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
string wavFilePath = Path.Combine(
|
||||
UserSettings.Default.AudioDirectory,
|
||||
SelectedAudioFile.FilePath.TrimStart('/'));
|
||||
|
|
|
|||
|
|
@ -1108,7 +1108,7 @@ public class CUE4ParseViewModel : ViewModel
|
|||
TabControl.SelectedTab.AddImage(sourceFile.SubstringAfterLast('/'), false, bitmap, false, updateUi);
|
||||
return false;
|
||||
}
|
||||
// The Dark Pictures Anthology
|
||||
// Supermassive Games (for example - The Dark Pictures Anthology: House of Ashes etc.)
|
||||
case UExternalSource when (isNone || saveAudio) && pointer.Object.Value is UExternalSource externalSource:
|
||||
{
|
||||
var audioName = Path.GetFileNameWithoutExtension(externalSource.ExternalSourcePath);
|
||||
|
|
@ -1166,6 +1166,10 @@ public class CUE4ParseViewModel : ViewModel
|
|||
case UAkMediaAssetData when isNone || saveAudio:
|
||||
case USoundWave when isNone || saveAudio:
|
||||
{
|
||||
// If UAkMediaAsset exists in the same package it should be used to handle the audio instead (because it contains actual audio name)
|
||||
if (pointer.Object.Value is UAkMediaAssetData dataObj && dataObj.Outer is UAkMediaAsset)
|
||||
return false;
|
||||
|
||||
var shouldDecompress = UserSettings.Default.CompressedAudioMode == ECompressedAudio.PlayDecompressed;
|
||||
pointer.Object.Value.Decode(shouldDecompress, out var audioFormat, out var data);
|
||||
var hasAf = !string.IsNullOrEmpty(audioFormat);
|
||||
|
|
@ -1178,6 +1182,36 @@ public class CUE4ParseViewModel : ViewModel
|
|||
SaveAndPlaySound(TabControl.SelectedTab.Entry.PathWithoutExtension.Replace('\\', '/'), audioFormat, data, saveAudio);
|
||||
return false;
|
||||
}
|
||||
case UAkMediaAsset when (isNone || saveAudio) && pointer.Object.Value is UAkMediaAsset akMediaAsset:
|
||||
{
|
||||
var audioName = akMediaAsset.MediaName;
|
||||
if (akMediaAsset.CurrentMediaAssetData?.TryLoad<UAkMediaAssetData>(out var akMediaAssetData) is true)
|
||||
{
|
||||
var shouldDecompress = UserSettings.Default.CompressedAudioMode is ECompressedAudio.PlayDecompressed;
|
||||
akMediaAssetData.Decode(shouldDecompress, out var audioFormat, out var data);
|
||||
|
||||
SaveAndPlaySound(audioName, audioFormat, data, saveAudio);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case UAkAudioEventData when (isNone || saveAudio) && pointer.Object.Value is UAkAudioEventData akAudioEventData:
|
||||
{
|
||||
var shouldDecompress = UserSettings.Default.CompressedAudioMode is ECompressedAudio.PlayDecompressed;
|
||||
foreach (var mediaIndex in akAudioEventData.MediaList)
|
||||
{
|
||||
if (mediaIndex.TryLoad<UAkMediaAsset>(out var akMediaAsset))
|
||||
{
|
||||
if (akMediaAsset.CurrentMediaAssetData?.TryLoad<UAkMediaAssetData>(out var akMediaAssetData) is true)
|
||||
{
|
||||
var audioName = akMediaAsset.MediaName ?? $"{akAudioEventData.Outer.Name} ({akMediaAsset.ID})";
|
||||
akMediaAssetData.Decode(shouldDecompress, out var audioFormat, out var data);
|
||||
|
||||
SaveAndPlaySound(audioName, audioFormat, data, saveAudio);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case UWorld when isNone && UserSettings.Default.PreviewWorlds:
|
||||
case UBlueprintGeneratedClass when isNone && UserSettings.Default.PreviewWorlds && TabControl.SelectedTab.ParentExportType switch
|
||||
{
|
||||
|
|
|
|||
|
|
@ -235,12 +235,14 @@ public class GameFileViewModel(GameFile asset) : ViewModel
|
|||
UObjectRedirector => (EAssetCategory.ObjectRedirector, EBulkType.None),
|
||||
UPhysicalMaterial => (EAssetCategory.PhysicalMaterial, EBulkType.None),
|
||||
|
||||
USoundAtomCue or UAkAudioEvent or USoundCue or UFMODEvent => (EAssetCategory.AudioEvent, EBulkType.Audio),
|
||||
USoundAtomCue or UAkAudioEvent or USoundCue or UFMODEvent
|
||||
or UAkAssetData or UAkAssetPlatformData => (EAssetCategory.AudioEvent, EBulkType.Audio),
|
||||
|
||||
UFMODBank or UAkAudioBank or UAtomWaveBank or UAkInitBank => (EAssetCategory.SoundBank, EBulkType.Audio),
|
||||
|
||||
UWwiseAssetLibrary or USoundBase or UAkMediaAssetData or UAtomCueSheet
|
||||
or USoundAtomCueSheet or UAkAudioType or UExternalSource or UExternalSourceBank => (EAssetCategory.Audio, EBulkType.Audio),
|
||||
or USoundAtomCueSheet or UAkAudioType or UExternalSource or UExternalSourceBank
|
||||
or UAkMediaAsset => (EAssetCategory.Audio, EBulkType.Audio),
|
||||
|
||||
UFileMediaSource => (EAssetCategory.Video, EBulkType.None),
|
||||
UFont or UFontFace or USMGLocaleFontUMG => (EAssetCategory.Font, EBulkType.None),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user