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)
- Experimental tool Dump LE1 TLK to XML HOT 1
- Soundplorer not updating WwiseEvents HOT 3
- Posted in wrong place
- Some meshes are not exporting in UDK format correctly HOT 1
- Saving PlotManagerAutoDLC file after editing BiOCodexMap breaks the file HOT 1
- Saving BIOC_Materials after editing in Plot Editor causes game to hang on Startup HOT 2
- Can not drag and drop packages in pcc files
- TLK Editor - "Recently Opened Items" permanently shown when opening via TLK Manager
- ConditionalParam not parsed by ConversationExtended
- (LE2) Can't replace AFC Entries in Soundplorer HOT 1
- Dump Wwisestreams experiment is unable to dump audio files from LE2 HOT 5
- Feature Request: UScript Importer HOT 3
- AssetDB: Custom File List only filters assets, not asset usages
- Plot Database: Various issues and feature requests when working with mod plot databases
- Minor UI bug: Menu bar submenus moved to fit the screen disappear when hovered over
- Re-organize wiki to sort tutorials by tool.
- Script Editor Feature Request: downgrade 'Class already exists' to a warning
- Bug: ComponentMap off-by-one error HOT 1
- ME2LE issue when exporting wwise BNK files HOT 2
- Audio mass export in original format, without converting to WAV or OGG, with original names
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.