Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

The Monolithic WMA/WMV Content Thread #2

Open
flibitijibibo opened this issue Feb 28, 2017 · 5 comments
Open

The Monolithic WMA/WMV Content Thread #2

flibitijibibo opened this issue Feb 28, 2017 · 5 comments

Comments

@flibitijibibo
Copy link
Collaborator

This is where we dump bugs related to Windows Media content not being fixed or bugs that are introduced by the content conversion.

Starting with a Stardew Valley WaveBank, which interestingly doesn't use xWMA at all:

System.IO.EndOfStreamException: Unable to read beyond the end of the stream.
  at System.IO.BinaryReader.FillBuffer (System.Int32 numBytes) [0x0008f] in /builddir/build/BUILD/mono-4.6.2/mcs/class/referencesource/mscorlib/system/io/binaryreader.cs:571 
  at System.IO.BinaryReader.ReadUInt32 () [0x00000] in /builddir/build/BUILD/mono-4.6.2/mcs/class/referencesource/mscorlib/system/io/binaryreader.cs:191 
  at Microsoft.Xna.Framework.Audio.WaveBank.LoadWaveBank (Microsoft.Xna.Framework.Audio.AudioEngine audioEngine, System.IO.BinaryReader reader, System.Boolean streaming) [0x00010] in /home/flibitijibibo/.wine/drive_c/Program Files/Steam/steamapps/common/Stardew Valley/XnaToFna/lib-projs/FNA/src/Audio/WaveBank.cs:293 
  at Microsoft.Xna.Framework.Audio.WaveBank..ctor (Microsoft.Xna.Framework.Audio.AudioEngine audioEngine, System.String nonStreamingWaveBankFilename) [0x00043] in /home/flibitijibibo/.wine/drive_c/Program Files/Steam/steamapps/common/Stardew Valley/XnaToFna/lib-projs/FNA/src/Audio/WaveBank.cs:181 
  at StardewValley.Game1.Initialize () [0x00117] in <8735ddc4c49943f59d59831f1ffc73cf>:0 
  at Microsoft.Xna.Framework.Game.DoInitialize () [0x0000f] in /home/flibitijibibo/.wine/drive_c/Program Files/Steam/steamapps/common/Stardew Valley/XnaToFna/lib-projs/FNA/src/Game.cs:828 
  at Microsoft.Xna.Framework.Game.Run () [0x00014] in /home/flibitijibibo/.wine/drive_c/Program Files/Steam/steamapps/common/Stardew Valley/XnaToFna/lib-projs/FNA/src/Game.cs:417 
  at StardewValley.Program.Main (System.String[] args) [0x00028] in <8735ddc4c49943f59d59831f1ffc73cf>:0
@0x0ade
Copy link
Owner

0x0ade commented Feb 28, 2017

For whatever reason, XnaToFna spits out a zero-byte file on Linux, also explaining why it fails so early, checking the file header...

@0x0ade
Copy link
Owner

0x0ade commented Feb 28, 2017

In src/Content/WaveBank.cs:

        public static void UpdateWaveBank(string path, BinaryReader reader, BinaryWriter writer) {
            if (!IsFFMPEGAvailable) return;
            Log($"[UpdateWaveBank] Updating wave bank {path}");
  1. There's a missing reader.BaseStream.CopyTo(writer.BaseStream); to at least fill the temporary output.
  2. XnaToFna.ContentHelper.IsFFMPEGAvailable incorrectly returns false on Linux.

@0x0ade
Copy link
Owner

0x0ade commented Feb 28, 2017

The following commit fixes the 0 byte XWB issue: 0ad8154

  1. If FFMPEG is not available, it just copies over the data from the input stream.
  2. I forgot that the platform enum is actually a flag enum, meaning a check != 0 was predetermined to fail in this specific case.

Additionally, 55c097c now makes XnaToFna log if FFMPEG is missing.

@0x0ade
Copy link
Owner

0x0ade commented Oct 22, 2017

cf99acf adds XMA2 "support," which is part of #3

@flibitijibibo flibitijibibo changed the title The Monolithic xWMA/WMA/WMV Content Thread The Monolithic WMA/WMV Content Thread Oct 5, 2018
@flibitijibibo
Copy link
Collaborator Author

xWMA should be covered by FNA-XNA/FAudio#32 instead of XnaToFna. If we wanted to be extra involved we could also implement a WMA backend for XNA_Song.c but honestly since we need a converter for WMV files anyway, I'm not too worried about that...

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants