Skip to content

Commit edebff0

Browse files
committed
Wwise audio events now trigger the audio player
and rename .wem files if the event references any ofc (no .bnk support yet)
1 parent 273b124 commit edebff0

File tree

4 files changed

+35
-8
lines changed

4 files changed

+35
-8
lines changed

CUE4Parse

Submodule CUE4Parse updated 76 files

FModel/MainWindow.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ await Task.WhenAll(
8585
#if DEBUG
8686
// await _threadWorkerView.Begin(cancellationToken =>
8787
// _applicationView.CUE4Parse.Extract(cancellationToken,
88-
// _applicationView.CUE4Parse.Provider["FortniteGame/Plugins/GameFeatures/BRMapCh6/Content/Maps/Hermes_Terrain/_Generated_/A6Z7VUFLP2917NVTLT6WZFOVC.umap"]));
88+
// _applicationView.CUE4Parse.Provider["Marvel/Content/Marvel/Wwise/Assets/Events/Music/music_new/event/Entry.uasset"]));
8989
#endif
9090
}
9191

FModel/ViewModels/AudioPlayerViewModel.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ public void SavePlaylist()
294294
{
295295
Save(a, true);
296296
}
297+
298+
FLogger.Append(ELog.Information, () => FLogger.Text($"Successfully saved {_audioFiles.Count} audio files", Constants.WHITE, true));
297299
});
298300
}
299301

@@ -329,16 +331,22 @@ public void Save(AudioFile file = null, bool auto = false)
329331
if (File.Exists(path))
330332
{
331333
Log.Information("{FileName} successfully saved", fileToSave.FileName);
332-
FLogger.Append(ELog.Information, () =>
334+
if (!auto)
333335
{
334-
FLogger.Text("Successfully saved ", Constants.WHITE);
335-
FLogger.Link(fileToSave.FileName, path, true);
336-
});
336+
FLogger.Append(ELog.Information, () =>
337+
{
338+
FLogger.Text("Successfully saved ", Constants.WHITE);
339+
FLogger.Link(fileToSave.FileName, path, true);
340+
});
341+
}
337342
}
338343
else
339344
{
340345
Log.Error("{FileName} could not be saved", fileToSave.FileName);
341-
FLogger.Append(ELog.Error, () => FLogger.Text($"Could not save '{fileToSave.FileName}'", Constants.WHITE, true));
346+
if (!auto)
347+
{
348+
FLogger.Append(ELog.Error, () => FLogger.Text($"Could not save '{fileToSave.FileName}'", Constants.WHITE, true));
349+
}
342350
}
343351
}
344352

FModel/ViewModels/CUE4ParseViewModel.cs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,25 @@ public void ExtractAndScroll(CancellationToken cancellationToken, string fullPat
835835
TabControl.SelectedTab.AddImage(sourceFile.SubstringAfterLast('/'), false, bitmap, false, updateUi);
836836
return false;
837837
}
838+
case UAkAudioEvent when isNone && pointer.Object.Value is UAkAudioEvent { EventCookedData: { } wwiseData }:
839+
{
840+
foreach (var kvp in wwiseData.EventLanguageMap)
841+
{
842+
if (!kvp.Value.HasValue) continue;
843+
844+
foreach (var media in kvp.Value.Value.Media)
845+
{
846+
if (!Provider.TrySaveAsset(Path.Combine("Game/WwiseAudio/", media.MediaPathName.Text), out var data)) continue;
847+
848+
var namedPath = string.Concat(
849+
Provider.ProjectName, "/Content/WwiseAudio/",
850+
media.DebugName.Text.SubstringBeforeLast('.').Replace('\\', '/'),
851+
" (", kvp.Key.LanguageName.Text, ")");
852+
SaveAndPlaySound(namedPath, media.MediaPathName.Text.SubstringAfterLast('.'), data);
853+
}
854+
}
855+
return false;
856+
}
838857
case UAkMediaAssetData when isNone:
839858
case USoundWave when isNone:
840859
{
@@ -847,7 +866,7 @@ public void ExtractAndScroll(CancellationToken cancellationToken, string fullPat
847866
return false;
848867
}
849868

850-
SaveAndPlaySound(Path.Combine(TabControl.SelectedTab.Entry.PathWithoutExtension).Replace('\\', '/'), audioFormat, data);
869+
SaveAndPlaySound(TabControl.SelectedTab.Entry.PathWithoutExtension.Replace('\\', '/'), audioFormat, data);
851870
return false;
852871
}
853872
case UWorld when isNone && UserSettings.Default.PreviewWorlds:

0 commit comments

Comments
 (0)