libertyernie / brawltools

BrawlBox and BrawlLib
http://forums.kc-mm.com/index.php?topic=67847.0
143 stars 31 forks source link

Attempting to export any ADPCM track in AC:CF is met with a crash #240

Open codyscodyscode opened 3 years ago

codyscodyscode commented 3 years ago

Game: Animal Crossing: City Folk

File "rv_forest.brsar" in "Sound" directory on disc. Within archive, structure "BGM -> MU01 -> SANBIKA". File "SANBIKA" throws the following error when attempt to export. All other files associated with ADPCM seem to do this too. Yet to find a single ADPCM file in this archive that will export without crashing. Error given is the same each time and is shown bellow.

Object reference not set to an instance of an object.
   at System.Audio.WAV.ToByteArray(IAudioStream source, Int32 samplePosition, Int32 maxSampleCount, Boolean appendSmplChunk)
   at BrawlLib.SSBB.ResourceNodes.RSARSoundNode.Export(String outPath)
   at BrawlBox.NodeWrappers.GenericWrapper.OnExport(String outPath, Int32 filterIndex)
   at BrawlBox.NodeWrappers.GenericWrapper.Export()
   at BrawlBox.NodeWrappers.GenericWrapper.ExportAction(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Wohlstand commented 1 year ago

I got absolutely the same error.

Wohlstand commented 1 year ago

Okay, I took some of my own investigations: you can't just export it as WAV, because there are NOT streams, there are SEQUENCES. I.e. there are kinds of MIDI files. To convert them into WAV-like formats, you should play them using BANKS (kind of SoundFonts). I exported them by different tools into BRSEQ formats, and I used a modified rseq2mid converter: rseq2midi.cpp.zip (I modded it because it generated faulty musics, and I also extended it to give resulted music files human-friendly names, grabbed from internals)