- Joined
- Jan 9, 2008
- Messages
- 818
- Reaction score
- 847
Keep it open source :OGonna release a new version soon, with lots of new feature !
Thanks for this, ' haha ' - although, I already had your source...
From 50e753cb4bfac4a0912d7c15e5ecab461a429680 Mon Sep 17 00:00:00 2001
From: retep998 <retep998@verizon.net>
Date: Wed, 1 May 2013 00:27:08 -0400
Subject: [PATCH] Fixed issue with koolk files
Signed-off-by: retep998 <retep998@verizon.net>
---
WzLib/WzFile.cs | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/WzLib/WzFile.cs b/WzLib/WzFile.cs
index 2b3622f..df5c925 100644
--- a/WzLib/WzFile.cs
+++ b/WzLib/WzFile.cs
@@ -177,14 +177,15 @@ namespace MapleLib.WzLib
Helpers.ErrorLogger.Log(Helpers.ErrorLevel.Critical, "[Error] Path is null");
return;
}
- WzBinaryReader reader = new WzBinaryReader(File.Open(this.path, FileMode.Open), WzIv);
+ FileStream file = File.Open(this.path, FileMode.Open);
+ WzBinaryReader reader = new WzBinaryReader(file, WzIv);
this.Header = new WzHeader();
this.Header.Ident = reader.ReadString(4);
this.Header.FSize = reader.ReadUInt64();
this.Header.FStart = reader.ReadUInt32();
this.Header.Copyright = reader.ReadNullTerminatedString();
+ file.Seek(this.Header.FStart, SeekOrigin.Begin);
reader.ReadBytes((int)(Header.FStart - reader.BaseStream.Position));
reader.Header = this.Header;
this.version = reader.ReadInt16();
--
1.8.0.msysgit.0
Thank You retep you helped me a lot last night.For anyone having issues with wz files created by koolk's map editor but doesn't want to hassle with koolk-breaker, here is a quick patch that will fix everything magically.
Code:From 50e753cb4bfac4a0912d7c15e5ecab461a429680 Mon Sep 17 00:00:00 2001 From: retep998 <retep998@verizon.net> Date: Wed, 1 May 2013 00:27:08 -0400 Subject: [PATCH] Fixed issue with koolk files Signed-off-by: retep998 <retep998@verizon.net> --- WzLib/WzFile.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/WzLib/WzFile.cs b/WzLib/WzFile.cs index 2b3622f..df5c925 100644 --- a/WzLib/WzFile.cs +++ b/WzLib/WzFile.cs @@ -177,14 +177,15 @@ namespace MapleLib.WzLib Helpers.ErrorLogger.Log(Helpers.ErrorLevel.Critical, "[Error] Path is null"); return; } - WzBinaryReader reader = new WzBinaryReader(File.Open(this.path, FileMode.Open), WzIv); + FileStream file = File.Open(this.path, FileMode.Open); + WzBinaryReader reader = new WzBinaryReader(file, WzIv); this.Header = new WzHeader(); this.Header.Ident = reader.ReadString(4); this.Header.FSize = reader.ReadUInt64(); this.Header.FStart = reader.ReadUInt32(); this.Header.Copyright = reader.ReadNullTerminatedString(); + file.Seek(this.Header.FStart, SeekOrigin.Begin); reader.ReadBytes((int)(Header.FStart - reader.BaseStream.Position)); reader.Header = this.Header; this.version = reader.ReadInt16(); -- 1.8.0.msysgit.0
Differences (header vs soundHeaderMask):
0x36 (short) - 0x01 0x02 (01 = voice, 02 = BGM, seems to be a sound channel selector).
0x38 (word) - (Sample rate)
0x3C (word) - 0x0bb8 0x2710 (Seems to be some round number like 1000, 3000 or 6000. Sample buffer length?)
0x4C - 0x4E 0x00
0x4D - 0x00 0x0A
0x4E - 0x01 0x02
0x4F - 0x00 0x01
0x50 - 0x71 0x00
0x51 - 0x05 0x00
Hi,
I'm considerably new to modding Maplestory, but I think that HaRepacker might be having some difficulties rebuilding IMGs containing voices (SkillVoice).
I was trying to port the Japanese Angelic Buster voices over from JMS to SEA. Unfortunately, changing any one voice with HaRepacker (even if the voice was merely extracted and re-inserted) just caused all voices in that image to be played at a really high sample rate.
Please feel to correct me if I am wrong here though! Maybe there's already a known explanation for that, but I just haven't found it.
As for what I did on my end to get voice replacement working, I got the halfword/short at 0x36 set to 0x01 instead of 0x02 and the 32-bit word at 0x3C set to 0x0bb8 instead of 0x2710.
Here are all the differences in the structures that I've noticed when comparing the headers of the SkillVoice files against the reference soundHeaderMask structure:
Code:Differences (header vs soundHeaderMask): 0x36 (short) - 0x01 0x02 (01 = voice, 02 = BGM, seems to be a sound channel selector). 0x38 (word) - (Sample rate) 0x3C (word) - 0x0bb8 0x2710 (Seems to be some round number like 1000, 3000 or 6000. Sample buffer length?) 0x4C - 0x4E 0x00 0x4D - 0x00 0x0A 0x4E - 0x01 0x02 0x4F - 0x00 0x01 0x50 - 0x71 0x00 0x51 - 0x05 0x00
Note: header refers to the header that precedes the MP3 file itself, which is the same for all voices under SkillVoice.
Halfword/short 0x36 seems to be a channel selector. Perhaps 0x02 causes it to be played under the BGM channel, causing it to be played back with the parameters of the BGM (Which presumably has a higher sample rate).
I'm not sure about the word at 0x3C. While just changing byte 0x36 to 0x01 allows voices to be played at their right sample rates... I noticed that the voices were cut off. Setting it to 0xBB0 solved that, although I'm not sure what that actually does.
On a side note, it seems like not all sounds are MP3 files. It appears that normal skill sounds are headerless wave files and the headers that precede these files are no different from their SkillVoice counterparts... on at least SEA.
I don't know about how well this works on other Maplestory versions like JMS, although I could possibly test on JMS if required. (JMS seems to have more variations in its voice MP3 header fields too, BTW)
Thank you for reading!
I noticed that MSEA uses MPEG Version 2 Layer 3, 24.0kbps bitrate for their audio file while JMS uses MPEG Version 1 Layer3, 48.0kbps bitrate and encoded with LAME3.97 for that same audio file, so I tried converting (yea, mass quality degradation) the JMS files to the same specs as MSEA's using Audacity. Same problem.
Thanks for any replies
Thanks for giving more technical information then I could have ever given. I also reported the same thing over in this thread: http://forum.ragezone.com/f701/encountered-problem-replacing-skill-voices-935343/
Just wondering if the type of mp3 file makes a difference? Since i mentioned in my thread
or it doesn't matter?
I haven't done any "serious" WZ editing in years. However, during the time that I did, I figured that JMS had some weird things going on. As haha01haha01 mentioned, their encryption is different from other versions as in it can't easily be predicted, hence the support for JMS is kinda mediocre. HaRepacker may be able to open one JMS WZ file, and be unable to open the others. Or sometimes, more than one encryption is used in the same WZ file. And the second thing that I realized is that many of JMS's "exclusive" sounds exceed the "typical" bit rate from GMS/SEA/KMS. I can't recall any from the top of my head as it's been years, but I remember seeing a few of their login screen music having bit rates that were higher than those of GMS/SEA/KMS. Anyways, back in the days, we had to insert a certain HEX string for certain bit rates. Perhaps, you should try experimenting and figuring out what HEX String you should insert for the bit rate of that sound.
As for the "FAIL" sign, I think it'd be located in Effect.wz. Probably Effect.wz > BasicEff.img. Not certain as I haven't done any WZ editing recently. I am just taking a guess here. Also, what are you planning to do with this? Are you trying to WZ edit jobs in? The best you can do is a skill cover rather than adding an entire job.
I haven't done any "serious" WZ editing in years. However, during the time that I did, I figured that JMS had some weird things going on. As haha01haha01 mentioned, their encryption is different from other versions as in it can't easily be predicted, hence the support for JMS is kinda mediocre.
And the second thing that I realized is that many of JMS's "exclusive" sounds exceed the "typical" bit rate from GMS/SEA/KMS. I can't recall any from the top of my head as it's been years, but I remember seeing a few of their login screen music having bit rates that were higher than those of GMS/SEA/KMS. Anyways, back in the days, we had to insert a certain HEX string for certain bit rates. Perhaps, you should try experimenting and figuring out what HEX String you should insert for the bit rate of that sound.
I see. Fortunately for you guys, I had a v134 GMS Setup on my computer, so I installed it, and checked out some Angelic Burster stuff. I've found the "Fail" effect when the soul battery is completely depleted. It is located in:
Effect.wz > BasicEff.img > RechargeFail
As for the other stuff, I will get back to you on that.
EDIT: Here is a GMS Skill.img from Sound.wz:You must be registered to see links
Try replacing your Skill.img in Sound.wz with this. Remember to keep a backup just in case it doesn't work!
I find it kind of odd that MapleStory uses that extra header data to determine how to play mp3 audio. With NoLifeStory I've always been able to just skip the header and pass the mp3 data directly to whatever mp3 library I had and it would work perfectly. I suppose the only way to fix this problem, short of simply switching to NoLifeStory, would be to add methods to maplelib2 and harepacker to access this extra header information.
Wait, really?I did notice that the normal skill sounds are headerless waveform sounds (not MP3s, so haRepacker partially backfires when dealing with them), so perhaps that was why they designed their storage file format to have a mandatory header in front of their sound files.
Wait, really?
What's the path to one of these example sounds, and version/region for that matter? I need to check this out for myself.
EDIT: Replacing Skill.img does nothing.
I did find the RechargeFail animation in the JMS Effect.wz file, but copying it over to the SEA equivalent does nothing... meaning that a more significant mod needs to be done (Which requires a skill that I haven't acquired yet). :mellow:
EDIT: Not really meaning to rant here... but I'm curious to know: in GMS, there aren't a huge number of typos? In SEA, nearly all the dialogs have a problem with the apostrophe character replaced with a 'f' instead, and there are grammatical errors in some dialogs.
Tear once said "Are you hungries again?". D:
Not to mention that the game became really, really unstable after the Angelic Buster patch.
In JMS, the Angelic Buster's skill sounds under Sound.wz/skill.img/65****** are all headerless WAV files. They have a sample rate of 22050 Hz, and are signed 16-bit, mono samples. HaRepacker can't play these files (either no sound is played or you get an exception), but extracting them and reading them with Audacity as raw audio data works.
What do you mean that replacing it does nothing? As in there is no sound whatsoever, or what's the case here?
Also, for the recharge fail, if the effect is not showing up, it means that the client doesn't have the information to know where to load the 'recharge fail' effect from. In other words, it would require a client edit, which we are unable to do. At least, 99% of us are unable to do.
Also, to answer you, in GMS, we do have a few mistakes, but it is still WAY better than SEA.
I have checked the sound files that you stated for GMS. And I've found that they are headerless MP3 files.