-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added proper README and debug packing script.
- Loading branch information
Showing
23 changed files
with
198 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file removed
BIN
-9.97 MB
ChaiFoxes.FMODAudio.Demos/ChaiFoxes.FMODAudio.Demos/Content/test.ogg
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<dllmap dll="fmod.dll" os="linux" cpu="x86" target="./x86/libfmod.so"/> | ||
<dllmap dll="fmod.dll" os="linux" cpu="x86-64" target="./x64/libfmod.so"/> | ||
</configuration> | ||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 0 additions & 37 deletions
37
ChaiFoxes.FMODAudio/ChaiFoxes.FMODAudio.Desktop/ChaiFoxes.FMODAudio.Desktop.targets
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | ||
|
||
 | ||
|
||
|
||
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. | ||
|
||
 | ||
|
||
|
||
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. | ||
|
||
 | ||
|
||
### 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: | ||
|
||
 | ||
|
||
|
||
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: | ||
|
||
|
||
 | ||
|
||
Make sure dll files will be copied to the output directory: | ||
|
||
 | ||
|
||
4. Navigate to your FMOD Linux API installation. From it navigate to `\api\core\lib`. | ||
This time you will see four directories: | ||
|
||
 | ||
|
||
You'll need only `x86` and `x86_64`. | ||
|
||
Each directory contains this: | ||
|
||
 | ||
|
||
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: | ||
|
||
 | ||
|
||
*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: | ||
|
||
 | ||
|
||
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: | ||
|
||
 | ||
|
||
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: | ||
|
||
 | ||
|
||
6. Select each `.so` file you've just copied, open their Properties and set their | ||
Build Action to `AndroidNativeLibrary`. | ||
|
||
 | ||
|
||
## 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. | ||
|
||
 | ||
|
||
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: **[email protected]** or on [Twitter](https://twitter.com/ChaiFoxes). | ||
|
||
|
||
*don't forget to pet your foxes* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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\ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.