FNA-XNA / FAudio

FAudio - Accuracy-focused XAudio reimplementation for open platforms
https://fna-xna.github.io/
Other
544 stars 73 forks source link

XACT COM Wrapper #27

Closed flibitijibibo closed 6 years ago

flibitijibibo commented 6 years ago

This is primarily for https://github.com/ValveSoftware/wine/issues/2 and is based on our existing COM wrapper support.

I just wrote up the code that should handle this, and thankfully XACT is a lot less complicated than XAudio...

https://github.com/FNA-XNA/FAudio/commit/4b6ee4a8d7f72a4d2f653d56cbd8c4430f1c6fe2

... but I dunno how to actually wire all this up properly. If someone wants to rip off the XAudio2 work and get this going, XACT games should start booting right away. There are some TODOs for streaming WaveBanks and notification callbacks but everything else should be okay.

CC: @JohanSmet @aeikum

flibitijibibo commented 6 years ago

You know how we have a whole bunch of project files for XAudio2_x.dll? GUESS WHAT XACT HAS TOO

https://github.com/FNA-XNA/FAudio/commit/e2bee6533d03653308c01c05267af37f46bcdbf8

flibitijibibo commented 6 years ago

Makefile updates are in:

https://github.com/FNA-XNA/FAudio/commit/c44d1e42fd8f510f5c862a424aaa23fa46909ebc

flibitijibibo commented 6 years ago

I/O wrappers are in and "might" work. Windows API is weird:

https://github.com/FNA-XNA/FAudio/commit/5bc7100338a563001367d9a4c65b7928fe481d90

flibitijibibo commented 6 years ago

... aaand notification unwrapping is in:

https://github.com/FNA-XNA/FAudio/commit/3c906bbbae09b997ffe71329b92f5205723efcd7

Once somebody does the VS projects we can test the actual code at the same time, then mark this as finished if it isn't terrible.

flibitijibibo commented 6 years ago

Threw together the VS projects with gedit and amazingly it works! Crashes almost instantly because Winterbottom wants to make a streaming WaveBank, but the parameters are really strange. Looking into this, but the point is the wrapper at least loads.

flibitijibibo commented 6 years ago

Fixed the crash on start, and it actually kinda works! In-memory WaveBanks work great, streaming not so much. It doesn't crash but I'm still really sure my iostream is crap:

https://github.com/FNA-XNA/FAudio/blob/master/cpp/win_iostream.c

Unfortunately there don't seem to be any streaming WaveBank samples in the DXSDK and I dunno very much about the Win32 CreateFile API, so this is where I have to defer to someone else (for real this time, I swear I'm done for the day).

flibitijibibo commented 6 years ago

Turns out my iostream was okay and my vtables were not:

https://github.com/FNA-XNA/FAudio/commit/0d5ae50bb674ee08ac9391cdcf35a4be82edba99

My test cases work now, so this is done!