FMOD Audio support (#597)
Some checks failed
FModel QA Builder / build (push) Has been cancelled

Co-authored-by: LongerWarrior <LongerWarrior@gmail.com>
This commit is contained in:
Masusder 2025-10-14 18:45:27 +02:00 committed by GitHub
parent f366ad1189
commit b51d539c24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 33 additions and 2 deletions

@ -1 +1 @@
Subproject commit aa9ce2eb0e0dc9dee5f1e848c78d811246818c55
Subproject commit c46484d743ec5e67394eceb2a0c2e61801ae89e6

View File

@ -295,7 +295,13 @@ public class AudioPlayerViewModel : ViewModel, ISource, IDisposable
Save(a, true);
}
FLogger.Append(ELog.Information, () => FLogger.Text($"Successfully saved {_audioFiles.Count} audio files", Constants.WHITE, true));
FLogger.Append(ELog.Information, () =>
{
FLogger.Text("Successfully saved audio from ", Constants.WHITE);
FLogger.Link(_audioFiles.First().FileName, _audioFiles.First().FilePath, true);
});
if (_audioFiles.Count > 1)
FLogger.Append(ELog.Information, () => FLogger.Text($"Successfully saved {_audioFiles.Count} audio files", Constants.WHITE, true));
});
}

View File

@ -64,6 +64,8 @@ using UE4Config.Parsing;
using Application = System.Windows.Application;
using FGuid = CUE4Parse.UE4.Objects.Core.Misc.FGuid;
using CUE4Parse.UE4.Objects.UObject.Editor;
using CUE4Parse.UE4.Assets.Exports.Fmod;
using CUE4Parse.UE4.FMod;
namespace FModel.ViewModels;
@ -130,6 +132,8 @@ public class CUE4ParseViewModel : ViewModel
public ConfigIni IoStoreOnDemand { get; }
private Lazy<WwiseProvider> _wwiseProviderLazy;
public WwiseProvider WwiseProvider => _wwiseProviderLazy.Value;
private Lazy<FModProvider> _fmodProviderLazy;
public FModProvider FmodProvider => _fmodProviderLazy?.Value;
public ConcurrentBag<string> UnknownExtensions = [];
public CUE4ParseViewModel()
@ -283,6 +287,7 @@ public class CUE4ParseViewModel : ViewModel
Provider.Initialize();
_wwiseProviderLazy = new Lazy<WwiseProvider>(() => new WwiseProvider(Provider, UserSettings.Default.WwiseMaxBnkPrefetch));
_fmodProviderLazy = new Lazy<FModProvider>(() => new FModProvider(Provider, UserSettings.Default.GameDirectory));
Log.Information($"{Provider.Versions.Game} ({Provider.Versions.Platform}) | Archives: x{Provider.UnloadedVfs.Count} | AES: x{Provider.RequiredKeys.Count} | Loose Files: x{Provider.Files.Count}");
});
}
@ -942,6 +947,26 @@ public class CUE4ParseViewModel : ViewModel
}
return false;
}
case UFMODEvent when isNone && pointer.Object.Value is UFMODEvent fmodEvent:
{
var extractedSounds = FmodProvider.ExtractEventSounds(fmodEvent);
var directory = Path.GetDirectoryName(fmodEvent.Owner?.Name) ?? "/FMOD/Desktop/";
foreach (var sound in extractedSounds)
{
SaveAndPlaySound(Path.Combine(directory, sound.Name), sound.Extension, sound.Data);
}
return false;
}
case UFMODBank when isNone && pointer.Object.Value is UFMODBank fmodBank:
{
var extractedSounds = FmodProvider.ExtractBankSounds(fmodBank);
var directory = Path.GetDirectoryName(fmodBank.Owner?.Name) ?? "/FMOD/Desktop/";
foreach (var sound in extractedSounds)
{
SaveAndPlaySound(Path.Combine(directory, sound.Name), sound.Extension, sound.Data);
}
return false;
}
case UAkMediaAssetData when isNone:
case USoundWave when isNone:
{