mirror of
https://github.com/4sval/FModel.git
synced 2026-04-24 23:10:44 -05:00
FMOD Audio support (#597)
Some checks failed
FModel QA Builder / build (push) Has been cancelled
Some checks failed
FModel QA Builder / build (push) Has been cancelled
Co-authored-by: LongerWarrior <LongerWarrior@gmail.com>
This commit is contained in:
parent
f366ad1189
commit
b51d539c24
|
|
@ -1 +1 @@
|
|||
Subproject commit aa9ce2eb0e0dc9dee5f1e848c78d811246818c55
|
||||
Subproject commit c46484d743ec5e67394eceb2a0c2e61801ae89e6
|
||||
|
|
@ -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));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user