diff --git a/ChaiFoxes.FMODAudio.Demos/ChaiFoxes.FMODAudio.Demos.Android/ChaiFoxes.FMODAudio.Demos.Android.csproj b/ChaiFoxes.FMODAudio.Demos/ChaiFoxes.FMODAudio.Demos.Android/ChaiFoxes.FMODAudio.Demos.Android.csproj index 8e537e2..d45ca1f 100644 --- a/ChaiFoxes.FMODAudio.Demos/ChaiFoxes.FMODAudio.Demos.Android/ChaiFoxes.FMODAudio.Demos.Android.csproj +++ b/ChaiFoxes.FMODAudio.Demos/ChaiFoxes.FMODAudio.Demos.Android/ChaiFoxes.FMODAudio.Demos.Android.csproj @@ -66,11 +66,6 @@ - - - - - @@ -95,6 +90,13 @@ + + + + + + + diff --git a/ChaiFoxes.FMODAudio.Demos/ChaiFoxes.FMODAudio.Demos/Content/test.ogg b/ChaiFoxes.FMODAudio.Demos/ChaiFoxes.FMODAudio.Demos/Content/test.ogg deleted file mode 100644 index d4472eb..0000000 Binary files a/ChaiFoxes.FMODAudio.Demos/ChaiFoxes.FMODAudio.Demos/Content/test.ogg and /dev/null differ diff --git a/ChaiFoxes.FMODAudio/ChaiFoxes.FMODAudio.Android/ChaiFoxes.FMODAudio.Android.csproj b/ChaiFoxes.FMODAudio/ChaiFoxes.FMODAudio.Android/ChaiFoxes.FMODAudio.Android.csproj index 5d24f32..03e7774 100644 --- a/ChaiFoxes.FMODAudio/ChaiFoxes.FMODAudio.Android/ChaiFoxes.FMODAudio.Android.csproj +++ b/ChaiFoxes.FMODAudio/ChaiFoxes.FMODAudio.Android/ChaiFoxes.FMODAudio.Android.csproj @@ -26,6 +26,7 @@ TRACE;DEBUG;ANDROID prompt 4 + bin\Debug\ChaiFoxes.FMODAudio.Android.xml pdbonly @@ -34,6 +35,7 @@ TRACE prompt 4 + bin\Release\ChaiFoxes.FMODAudio.Android.xml @@ -57,8 +59,9 @@ - - + + Designer + diff --git a/ChaiFoxes.FMODAudio/ChaiFoxes.FMODAudio.Android/ChaiFoxes.FMODAudio.Android.nuspec b/ChaiFoxes.FMODAudio/ChaiFoxes.FMODAudio.Android/ChaiFoxes.FMODAudio.Android.nuspec index 39cae55..bcf5f4e 100644 --- a/ChaiFoxes.FMODAudio/ChaiFoxes.FMODAudio.Android/ChaiFoxes.FMODAudio.Android.nuspec +++ b/ChaiFoxes.FMODAudio/ChaiFoxes.FMODAudio.Android/ChaiFoxes.FMODAudio.Android.nuspec @@ -7,11 +7,14 @@ gn Fur Chai Foxes https://github.com/gnFur/ChaiFoxes.FMODAudio - https://raw.githubusercontent.com/gnFur/ChaiFoxes.FMODAudio/master/Icon/logofoxe.png?raw=true + https://raw.githubusercontent.com/gnFur/ChaiFoxes.FMODAudio/master/Icon/icon.png false - FMOD library wrapper for Monogame Android. + FMOD library wrapper for Android Monogame projects. Added foxes. Copyright 2019 fmod audio monogame android + + + \ No newline at end of file diff --git a/ChaiFoxes.FMODAudio/ChaiFoxes.FMODAudio.Desktop/App.config b/ChaiFoxes.FMODAudio/ChaiFoxes.FMODAudio.Desktop/App.config index 0ae8f97..33809bd 100644 --- a/ChaiFoxes.FMODAudio/ChaiFoxes.FMODAudio.Desktop/App.config +++ b/ChaiFoxes.FMODAudio/ChaiFoxes.FMODAudio.Desktop/App.config @@ -1,5 +1,5 @@ - + - \ No newline at end of file + diff --git a/ChaiFoxes.FMODAudio/ChaiFoxes.FMODAudio.Desktop/ChaiFoxes.FMODAudio.Desktop.csproj b/ChaiFoxes.FMODAudio/ChaiFoxes.FMODAudio.Desktop/ChaiFoxes.FMODAudio.Desktop.csproj index 68ae4b1..f48e42b 100644 --- a/ChaiFoxes.FMODAudio/ChaiFoxes.FMODAudio.Desktop/ChaiFoxes.FMODAudio.Desktop.csproj +++ b/ChaiFoxes.FMODAudio/ChaiFoxes.FMODAudio.Desktop/ChaiFoxes.FMODAudio.Desktop.csproj @@ -9,9 +9,10 @@ Properties ChaiFoxes.FMODAudio ChaiFoxes.FMODAudio - v4.6.2 + v4.5 512 true + true @@ -21,6 +22,7 @@ DEBUG;TRACE prompt 4 + bin\Debug\ChaiFoxes.FMODAudio.xml pdbonly @@ -29,6 +31,7 @@ TRACE prompt 4 + bin\Release\ChaiFoxes.FMODAudio.xml @@ -49,7 +52,9 @@ - + + Designer + PreserveNewest diff --git a/ChaiFoxes.FMODAudio/ChaiFoxes.FMODAudio.Desktop/ChaiFoxes.FMODAudio.Desktop.nuspec b/ChaiFoxes.FMODAudio/ChaiFoxes.FMODAudio.Desktop/ChaiFoxes.FMODAudio.Desktop.nuspec index 712f755..4405153 100644 --- a/ChaiFoxes.FMODAudio/ChaiFoxes.FMODAudio.Desktop/ChaiFoxes.FMODAudio.Desktop.nuspec +++ b/ChaiFoxes.FMODAudio/ChaiFoxes.FMODAudio.Desktop/ChaiFoxes.FMODAudio.Desktop.nuspec @@ -7,16 +7,11 @@ gn Fur Chai Foxes https://github.com/gnFur/ChaiFoxes.FMODAudio - https://raw.githubusercontent.com/gnFur/ChaiFoxes.FMODAudio/master/Icon/icon.png?raw=true + https://raw.githubusercontent.com/gnFur/ChaiFoxes.FMODAudio/master/Icon/icon.png false - FMOD library wrapper for Monogame DesktopGL. Supports Windows and Linux. + FMOD library wrapper for Windows and Linux Monogame projects. Added foxes. Copyright 2019 fmod audio monogame windows linux - - - - - \ No newline at end of file diff --git a/ChaiFoxes.FMODAudio/ChaiFoxes.FMODAudio.Desktop/ChaiFoxes.FMODAudio.Desktop.targets b/ChaiFoxes.FMODAudio/ChaiFoxes.FMODAudio.Desktop/ChaiFoxes.FMODAudio.Desktop.targets deleted file mode 100644 index cd3a82e..0000000 --- a/ChaiFoxes.FMODAudio/ChaiFoxes.FMODAudio.Desktop/ChaiFoxes.FMODAudio.Desktop.targets +++ /dev/null @@ -1,37 +0,0 @@ - - - - x64\fmod.dll - PreserveNewest - - - x64\libfmod.so - PreserveNewest - - - x64\libfmod.so.11 - PreserveNewest - - - x64\libfmod.so.11.0 - PreserveNewest - - - - x86\fmod.dll - PreserveNewest - - - x86\libfmod.so - PreserveNewest - - - x86\libfmod.so.11 - PreserveNewest - - - x86\libfmod.so.11.0 - PreserveNewest - - - \ No newline at end of file diff --git a/README.md b/README.md index b357c08..89ce029 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,168 @@ -# ChaiFoxes.FMOD -Cross-platform C# FMOD wrapper. +# ChaiFoxes.FMODAudio + +*I suffer so you don't have to.* + +**NOTE: CURRENTLY THIS LIBRARY IS IN DEVELOPMENT AND NUGET PACKAGES ARE NOT AVAILABLE** + +The time has come. You're finally witnessing a high-level cross-platform C# library, which makes Monogame and FMOD best friends. + +![header](C:/D/_Projects/ChaiFoxes.FMOD/pics/ebites.png) + + +In case you came here and the only thing you got so far was that hilarious doge meme, +[FMOD](http://fmod.org) is quite powerful cross-platform audio engine, which is +pretty much the only hope to have any decent audio in Monogame. + +The catch is - FMOD is written in C++, and the only thing C# overlords got +is bare-bones C# wrapper. No tutorials, no setup guides. Only you and DllImport. + +![send help](C:/D/_Projects/ChaiFoxes.FMOD/pics/help.png) + + +This is why this library exists. It does the tough part for you, loads and sets +everything up, plus provides some basic high-level interface. + +Also note that even though primary target of this library is Monogame, its sources +will be very useful if you want to use FMOD in some other C#-based project. + +## Setup + +Setting things up is a little fiddly. Here's the thing - FMOD license prohibits me from +distributing from distributing their libraries with my Nuget package - so you have to +download them yourself. + +### Preparations. + +Go to the [FMOD Download page](https://www.fmod.com/download) (accessing it requires +registration), find FMOD Studio API downloads and download APIs for Windows, Linux +and Android. If you're going to set up all three, of course. + + +Windows API requires installation, Linux and Android doesn't. You can drop them near +Windows API just to have everything in one place. + +![setup1](C:/D/_Projects/ChaiFoxes.FMOD/pics/setup1.png) + +### Windows & Linux + +1. Open your DesktopGL or SharpDX Monogame project. +2. Install NuGet package ChaiFoxes.FMODAudio.Desktop. Alternatively, you can compile +it from sources. +3. Navigate to your FMOD Windows API installation. From it navigate to `\api\core\lib`. +You will see two directories: x64 and x86. Each one will contain this: + +![setup2](C:/D/_Projects/ChaiFoxes.FMOD/pics/setup2.png) + + +Out of all the files you'll need only `fmod.dll` from both `x86` and `x64` directories. +Your Monogame project should already have `x86` and `x64` directories +(if you don't - just create them) - copy corresponding versions of `fmod.dll` +into them. You should end up with it looking like this: + + +![setup3](C:/D/_Projects/ChaiFoxes.FMOD/pics/setup3.png) + +Make sure dll files will be copied to the output directory: + +![setup4](C:/D/_Projects/ChaiFoxes.FMOD/pics/setup4.png) + +4. Navigate to your FMOD Linux API installation. From it navigate to `\api\core\lib`. +This time you will see four directories: + +![setup5](C:/D/_Projects/ChaiFoxes.FMOD/pics/setup5.png) + +You'll need only `x86` and `x86_64`. + +Each directory contains this: + +![setup6](C:/D/_Projects/ChaiFoxes.FMOD/pics/setup6.png) + +You will need only `libfmod` files - those without L. Copy fmod files from `x86` +directory to `x86` directory of your project, and then copy files from `x86_64` +to your `x64` directory. You'll end up with this: + +![setup7](C:/D/_Projects/ChaiFoxes.FMOD/pics/setup7.png) + +*NOTE: If you're going for Linux-only build, you can exclude fmod.dll files.* + +Again, make sure all the files you've just added will be copied +to the output directory: + +![setup4](C:/D/_Projects/ChaiFoxes.FMOD/pics/setup4.png) + +And that's it - you got yourself cross-platform desktop FMOD! + +### Android + +1. Open your Monogame Android project. +2. Install NuGet package ChaiFoxes.FMODAudio.Android. Alternatively, you can compile +it from sources. +3. Create `libs` directory in the root of your project. +4. Navigate to your FMOD Android API installation. From it navigate to `\api\core\lib`. +You will see this: + +![setup8](C:/D/_Projects/ChaiFoxes.FMOD/pics/setup8.png) + +5. Each folder contains `libfmod.so` and `libfmodL.so` files. +You need only `libfmod.so` from each directory. Copy everything over to your `libs` +directory. You'll end up with this: + +![setup9](C:/D/_Projects/ChaiFoxes.FMOD/pics/setup9.png) + +6. Select each `.so` file you've just copied, open their Properties and set their +Build Action to `AndroidNativeLibrary`. + +![setup10](C:/D/_Projects/ChaiFoxes.FMOD/pics/setup10.png) + +## Playing some tunes! + +So, after you've set up everything, it's time to bop some pops, as kids say these days. + +1. Find some sound file and import it into Content Pipeline. +2. Select sound file and set its Build Action to Copy. + +![setup11](C:/D/_Projects/ChaiFoxes.FMOD/pics/setup11.png) + +3. Include ChaiFoxes.FMODAudio namespace and paste the following code in your +Initialize() method: + +``` +AudioMgr.Init("Content/"); + +var sound = AudioMgr.LoadStreamedSound("test.mp3"); +var group = AudioMgr.CreateChannelGroup("group"); +AudioMgr.PlaySound(sound, group); +``` +4. Compile and hope that you (and me) did everything right. + +You can also check out demo project included in sources. Though, note that it requires +main library project to be present and compiled in Debug. You can also replace project reference +to Nuget packages. + +## But what about other platforms? + +I'd like to make console versions of the library - but currently I have no ability +to do so, and probably won't have for a long time. As for UWP an Apple platforms, +I just don't care about them enough. + +If you want to be a hero and expand the library with any of those platfrorms yourself - +contact me and we'll figure something out. ; - ) + + +## License and legal stuffs + +This library is licensed under MPL 2.0, so you can use it and its code in any +shenanigans you want. Free games, commercial games, anything - no payment or +royalties required. Just leave a credit. ; - ) + +But the show's main star is a bit different. FMOD has its own [license](https://fmod.com/licensing#faq), +which is much less permissive than mine. + +Demo [music](https://www.youtube.com/watch?v=zZ81qi90E-Y) is provided by Agrofox. + +## Fin. + +Want to contribute, suggest a feature or just want to pour shit on my code? Feel free to contact me via email: **chaifoxes@gmail.com** or on [Twitter](https://twitter.com/ChaiFoxes). + + +*don't forget to pet your foxes* diff --git a/packDebug.bat b/packDebug.bat new file mode 100644 index 0000000..7c21313 --- /dev/null +++ b/packDebug.bat @@ -0,0 +1,2 @@ +nuget pack ChaiFoxes.FMODAudio\ChaiFoxes.FMODAudio.Desktop\ChaiFoxes.FMODAudio.Desktop.csproj -Properties Configuration=Release -OutputDirectory Release\ +nuget pack ChaiFoxes.FMODAudio\ChaiFoxes.FMODAudio.Android\ChaiFoxes.FMODAudio.Android.csproj -Properties Configuration=Release -OutputDirectory Release\ diff --git a/pics/ebites.png b/pics/ebites.png new file mode 100644 index 0000000..b4a883f Binary files /dev/null and b/pics/ebites.png differ diff --git a/pics/help.png b/pics/help.png new file mode 100644 index 0000000..4d02e8f Binary files /dev/null and b/pics/help.png differ diff --git a/pics/setup1.png b/pics/setup1.png new file mode 100644 index 0000000..e80ecba Binary files /dev/null and b/pics/setup1.png differ diff --git a/pics/setup10.png b/pics/setup10.png new file mode 100644 index 0000000..390891a Binary files /dev/null and b/pics/setup10.png differ diff --git a/pics/setup11.png b/pics/setup11.png new file mode 100644 index 0000000..e78612e Binary files /dev/null and b/pics/setup11.png differ diff --git a/pics/setup2.png b/pics/setup2.png new file mode 100644 index 0000000..9d84c8c Binary files /dev/null and b/pics/setup2.png differ diff --git a/pics/setup3.png b/pics/setup3.png new file mode 100644 index 0000000..d6bea69 Binary files /dev/null and b/pics/setup3.png differ diff --git a/pics/setup4.png b/pics/setup4.png new file mode 100644 index 0000000..7691a6c Binary files /dev/null and b/pics/setup4.png differ diff --git a/pics/setup5.png b/pics/setup5.png new file mode 100644 index 0000000..a8babb7 Binary files /dev/null and b/pics/setup5.png differ diff --git a/pics/setup6.png b/pics/setup6.png new file mode 100644 index 0000000..17b63e1 Binary files /dev/null and b/pics/setup6.png differ diff --git a/pics/setup7.png b/pics/setup7.png new file mode 100644 index 0000000..30897c2 Binary files /dev/null and b/pics/setup7.png differ diff --git a/pics/setup8.png b/pics/setup8.png new file mode 100644 index 0000000..50ff349 Binary files /dev/null and b/pics/setup8.png differ diff --git a/pics/setup9.png b/pics/setup9.png new file mode 100644 index 0000000..e530696 Binary files /dev/null and b/pics/setup9.png differ