Permalink
Browse files

Improved SongVolume parser to get correct values. Fixed #333

  • Loading branch information...
L0FKA committed Jan 19, 2019
1 parent bb9b603 commit 16013f0089fddc0f67d765e816ba98d5c3f199b8
@@ -29,5 +29,5 @@
//
// THESE VALUES ARE PROGRAMMATICALLY GENERATED - DO NOT EDIT
[assembly: AssemblyVersion("2.9.1.0")]
[assembly: AssemblyInformationalVersion("f0052fa8")]
[assembly: AssemblyInformationalVersion("bb9b6035")]
[assembly: AssemblyConfiguration("BETA")]
@@ -571,8 +571,8 @@ public static string ReadWemFileId(string srcPath, Platform platform)
/// <summary>
/// Given a .bnk file, read the audio volume factor
/// </summary>
/// <param name="srcPath"></param>
/// <param name="platform"></param>
/// <param name="srcPath">Wwise bnk file</param>
/// <param name="platform">Game platform to detect endianness</param>
/// <returns></returns>
public static float? ReadVolumeFactor(string srcPath, Platform platform)
{
@@ -598,9 +598,18 @@ public static string ReadWemFileId(string srcPath, Platform platform)
// find correct object type - SFXV
if (typeId == 2)
{
// skip 46 bytes to find volume factor
reader.ReadBytes(46);
// skip 42 bytes to get params count
reader.ReadBytes(42);

// new bnk has 4, old should have 3
var pnum = reader.ReadByte();

//we could do a toaster here to see where's volume value is
//but I'm solidly hopping they won't hange it's order...
//skip paramType section
reader.ReadBytes(pnum);

// fetch volume factor (Param0 value)
return reader.ReadSingle();
}

@@ -27,5 +27,5 @@
//
// THESE VALUES ARE PROGRAMMATICALLY GENERATED - DO NOT EDIT
[assembly: AssemblyVersion("2.9.1.0")]
[assembly: AssemblyInformationalVersion("f0052fa8")]
[assembly: AssemblyInformationalVersion("bb9b6035")]
[assembly: AssemblyConfiguration("BETA")]
@@ -29,5 +29,5 @@
//
// THESE VALUES ARE PROGRAMMATICALLY GENERATED - DO NOT EDIT
[assembly: AssemblyVersion("2.9.1.0")]
[assembly: AssemblyInformationalVersion("f0052fa8")]
[assembly: AssemblyInformationalVersion("bb9b6035")]
[assembly: AssemblyConfiguration("BETA")]
@@ -1,3 +1,3 @@
2.9.1.0
f0052fa8
bb9b6035
BETA

0 comments on commit 16013f0

Please sign in to comment.