Comments (9)
I changed the code
to the following, and now can correcly reference the audio in LE1 now. Please check!
if (exportEntry.ClassName == "SoundNodeWave") {
CurrentLoadedExport = exportEntry;
ExportInformationList.Add($"#{exportEntry.UIndex} {exportEntry.ClassName} : {exportEntry.ObjectName.Instanced}");
var soundNodeWave = exportEntry.GetBinaryData<SoundNodeWave>();
if (soundNodeWave.RawData.Length > 0) {
ISACTBankPair ibp = ISACTHelper.GetPairedBanks(soundNodeWave.RawData);
foreach (var isbC in ibp.ISBBank.GetAllBankChunks().Where(x => x.ChunkName == "data")) {
var objectParent = isbC.GetParent();
if (objectParent != null) {
ExportInformationList.Add(objectParent);
}
}
} else {
var bsd = exportEntry.GetProperty<ObjectProperty>("BioStreamingData");
if (bsd == null) {
ExportInformationList.Add("This export contains no embedded audio");
return;
}
// Imports are very unreliable here and will be slow to load
if (bsd.ResolveToEntry(exportEntry.FileRef) is ExportEntry streamingData) {
// Remove the ISB: prefix
var indexEntryName = exportEntry.ObjectName.Instanced.Substring(exportEntry.ObjectName.Instanced.IndexOf(":") + 1);
ISACTBankPair ibp = ISACTHelper.GetPairedBanks(streamingData.GetBinaryData().Skip(4).ToArray());
IndexEntry foundICBInfo = null;
if (ibp.ICBBank.GetAllBankChunks().FirstOrDefault(x => x.ChunkName == ContentIndexBankChunk.FixedChunkTitle) is ContentIndexBankChunk contentIndex) {
// Find info about sample in ICB so we can get entry in ISB
foreach (var p in contentIndex.IndexPages) {
if (foundICBInfo != null)
break;
foreach (var indexEntry in p.IndexEntries) {
if (indexEntry.Title == indexEntryName) {
foundICBInfo = indexEntry;
break;
}
}
}
}
if (foundICBInfo == null) {
ExportInformationList.Add("Could not find information about this sound in the streaming data ICB");
return;
}
var referencedSndeChunk = ibp.ICBBank.GetAllBankChunks().OfType<ISACTListBankChunk>().FirstOrDefault(x =>
x.GetAllSubChunks().Any(a => a is IntBankChunk { ChunkName: "indx" } ac && ac.Value == foundICBInfo.ObjectIndex));
if (referencedSndeChunk == null) {
ExportInformationList.Add("Could not find snde chunk about this sound in the streaming data ICB");
return;
}
var soundTracks = referencedSndeChunk.GetAllSubChunks().OfType<SoundEventSoundTracksFour>().FirstOrDefault();
if (soundTracks == null) {
ExportInformationList.Add("Could not find sound track about this sound in the streaming data ICB");
return;
}
foreach (var soundTrack in soundTracks.SoundTracks) {
var isbIndex = soundTrack.BufferIndex & 0xFFFF;
var sampChunk = ibp.ISBBank.GetAllBankChunks().OfType<ISACTListBankChunk>().FirstOrDefault(x =>
x.ObjectType == "samp" && x.GetAllSubChunks().Any(a => a is IntBankChunk { ChunkName: "indx" } ac && ac.Value == isbIndex));
if (sampChunk == null) {
ExportInformationList.Add($"Could not find samp resource index {isbIndex} in streaming ISB referenced by ICB");
continue;
}
if (sampChunk.SampleOffset != null) {
ExportInformationList.Add(sampChunk);
ExportInfoListBox.SelectedItem = sampChunk; // Select it so playback is easier to start
} else {
ExportInformationList.Add("The ISB data for this entry does not list an external ISB offset for some reason");
}
}
} else {
ExportInformationList.Add("Audio data can only load in the toolset if the streaming data is an export");
}
}
}
from legendaryexplorer.
And in
Changes to
foreach (var filePath in files) //handle cases of mods/dlc having same file.
{
bool isBaseFile = cdir.ToLower() == "biogame";
bool isDLCFile = filePath.ToLower().Contains("dlc");
if (isBaseFile == isDLCFile)
{
continue;
}
audioPcc = MEPackageHandler.OpenMEPackage(filePath);
if (currentGame.IsGame1()) {
var stream = audioPcc.Exports.FirstOrDefault(x => x.ClassName == "SoundNodeWave" && x.InstancedFullPath.ToLower().EndsWith(searchWav));
if (stream != null) {
SoundpanelWPF_ADB.LoadExport(stream);
break;
}
audioPcc.Dispose();
} else {
var stream = audioPcc.Exports.FirstOrDefault(x => x.ClassName == "WwiseStream" && x.ObjectNameString.ToLower().Contains(searchWav));
if (stream != null) {
SoundpanelWPF_ADB.LoadExport(stream);
break;
}
audioPcc.Dispose();
}
}
from legendaryexplorer.
Hi, I'll dig through my notes and see what I have for this. I know the lookup code was jank - it worked on some but not on all, but then I got busy working on other things.
from legendaryexplorer.
Hi, I'll dig through my notes and see what I have for this. I know the lookup code was jank - it worked on some but not on all, but then I got busy working on other things.
Thanks, I just run through all lines in LE1 and these code matches all texts & voices nicely.
Currently I'm not able to create a PR, so I'll just leave it to you ~
from legendaryexplorer.
If you want to make a pull request for this, I can merge it for you.
from legendaryexplorer.
I created the PR #395
from legendaryexplorer.
Looking at my notes, I have notes that this the buffer index is indeed a 32bit unsigned long. I'm not really sure why ISACT stores it like this, internally maybe the upper bits were used for something else, but as far I can tell, they aren't.
from legendaryexplorer.
LOL, I cannot find literally anything about this format. But it works, yeahy~
from legendaryexplorer.
Please remove the change to GetConvoLinesBackground(), as it does not have to do with this PR. I will commit it separately.
from legendaryexplorer.
Related Issues (20)
- feature request: gltf mesh export HOT 2
- LE1 - LOC_INT.pcc files? HOT 5
- Meshplorer: Replacing meshes with different bone counts HOT 3
- More intuitive TFC path lookup for creation or appending on texture import.
- Feature request: LLE: toggle active and hidden HOT 2
- Application crashes when you abort closing application
- Mass Effect 1 (OT1) dialogue nodes can not be opened in InterpEditor HOT 1
- StaticMeshComponent Error After Cloning and Adding Multiple Actors in LE2 HOT 2
- Cannot clone sequences with attached events in different sequences
- Can make support other platform? HOT 1
- Sequence Editor - very difficult to determine current sequence on modification/save
- Crash on exit of many package editor windows
- Can't export mesh from ME3 mods
- Recompiling some SFXGame classes breaks the game (LE1/LE3) HOT 4
- LLE stops working if "BioD_Arvlvl3_230_Mainframe" is visible (not loaded) in LE2 HOT 6
- at least two images from the Asset Database wiki page are broken HOT 6
- Experimental tool Dump LE1 TLK to XML HOT 1
- Soundplorer not updating WwiseEvents HOT 3
- Posted in wrong place
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from legendaryexplorer.