All Projects → Martenfur → Chaifoxes.fmodaudio

Martenfur / Chaifoxes.fmodaudio

Licence: mpl-2.0
Cross-platform C# FMOD wrapper.

Projects that are alternatives of or similar to Chaifoxes.fmodaudio

Fdwaveformview
Reads an audio file and displays the waveform
Stars: ✭ 997 (+1894%)
Mutual labels:  audio
Html5 audio visualizer
An audio spectrum visualizer built with HTML5 Audio API
Stars: ✭ 1,025 (+1950%)
Mutual labels:  audio
Pandoraplayer
🅿️ PandoraPlayer is a lightweight music player for iOS, based on AudioKit and completely written in Swift.
Stars: ✭ 1,037 (+1974%)
Mutual labels:  audio
Cpal
Cross-platform audio I/O library in pure Rust
Stars: ✭ 1,001 (+1902%)
Mutual labels:  audio
Baseplug
MVC audio plugin framework for rust
Stars: ✭ 44 (-12%)
Mutual labels:  audio
Simpletones.js
The goal of simpleTones.js is to provide every JavaScript developer with a lightweight solution for creating custom sounds in their web applications. This documentation has been written in hopes that the least experienced developer can read, understand and go on to do great things. You can check out several examples at this link:
Stars: ✭ 45 (-10%)
Mutual labels:  audio
Vst2
Bindings for vst2 sdk
Stars: ✭ 39 (-22%)
Mutual labels:  audio
Audioplayers
A Flutter plugin to play multiple audio files simultaneously (Android/iOS)
Stars: ✭ 1,042 (+1984%)
Mutual labels:  audio
Aplay
A Better(Maybe) iOS Audio Stream、Cache、Play Framework
Stars: ✭ 44 (-12%)
Mutual labels:  audio
Sonorous
Sonorous streamlines working with web audio, enabling easy audio integration into web apps and games.
Stars: ✭ 47 (-6%)
Mutual labels:  audio
Awesome Python Scientific Audio
Curated list of python software and packages related to scientific research in audio
Stars: ✭ 1,015 (+1930%)
Mutual labels:  audio
Avsr Deep Speech
Google Summer of Code 2017 Project: Development of Speech Recognition Module for Red Hen Lab
Stars: ✭ 43 (-14%)
Mutual labels:  audio
Cabbage
A video composition framework build on top of AVFoundation. It's simple to use and easy to extend.
Stars: ✭ 1,030 (+1960%)
Mutual labels:  audio
Rsoundio
Rust binding for libsound.io
Stars: ✭ 40 (-20%)
Mutual labels:  audio
Keras Sincnet
Keras (tensorflow) implementation of SincNet (Mirco Ravanelli, Yoshua Bengio - https://github.com/mravanelli/SincNet)
Stars: ✭ 47 (-6%)
Mutual labels:  audio
Gameboy Css
👾 Pure CSS GameBoy - Includes animations and the original sound 🔊
Stars: ✭ 39 (-22%)
Mutual labels:  audio
Ffmpeg Example
FFMPEG 0.11-4.4/LibAV 0.8-11 example application with byte exact reading
Stars: ✭ 44 (-12%)
Mutual labels:  audio
Web Synth
A web-based sound synthesis, music production, and audio experimentation platform
Stars: ✭ 47 (-6%)
Mutual labels:  audio
Vyplayindicator
PlayIndicator inspired by Apple's Music Player.
Stars: ✭ 47 (-6%)
Mutual labels:  audio
Fundsp
Audio DSP library featuring an inline graph notation for audio processing
Stars: ✭ 45 (-10%)
Mutual labels:  audio

logo

I suffer so you won't have to.

The time has come. You're finally witnessing a high-level cross-platform C# library, which makes Monogame and FMOD best friends.

header

In case you came here and the only thing you got so far was that hilarious doge meme, FMOD 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 have is a bare-bones C# wrapper. No tutorials, no setup guides. Only you and DllImport.

send help

That's why this library exists. It does the tough part for you, and provides basic high-level interface.

Also note that even though the 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

Initial setup is a little fiddly. Here's the thing - the FMOD license prohibits me from distributing their libraries in my Nuget package - so you have to download them yourself. But fear not, I've put together a detailed guide. With pictures.

Preparations

Visit the FMOD Download page (accessing it requires registration), find the FMOD Studio API downloads and get APIs for Windows, Linux and Android. If you're going to set up all three, of course.

NOTE: Current version of the library was tested on FMOD v2.00.08. I really recommend getting it. Later versions will probably also work, but I have no guarantee.

Windows API requires installation, Linux and Android don't. You can drop them near the Windows API just to have everything in one place.

setup1

Windows & Linux

  1. Open your DesktopGL or SharpDX Monogame project.
  2. Install the NuGet package ChaiFoxes.FMODAudio.Desktop. Alternatively, you can plug repo as a submodule and reference projects directly.
  3. Navigate to your FMOD Windows API installation. From there navigate to \api\core\lib. You will see two directories: x64 and x86. Each one will contain this:

setup2

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 it doesn't - just create them). Copy corresponding versions of fmod.dll into them. You should end up with it looking like this:

setup3

Make sure dll files will be copied to the output directory:

setup4

  1. Navigate to your FMOD Linux API installation. From there navigate to \api\core\lib. This time you will see four directories:

setup5

You'll need only x86 and x86_64.

Each directory contains this:

setup6

You will only need libfmod files - the ones 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

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

And that's it - you've gotten yourself cross-platform desktop FMOD! Dllmap for Linux is already done internally, no need to worry about that.

Android

  1. Open your Monogame Android project.
  2. Install NuGet package ChaiFoxes.FMODAudio.Android. Alternatively, you can plug repo as a submodule and reference projects directly.
  3. Create libs directory in the root of your project.
  4. Navigate to your FMOD Android API installation. From there navigate to \api\core\lib. You will see this:

setup8

  1. Each folder contains libfmod.so and libfmodL.so. You need only libfmod.so from each directory. Copy everything except .jar file over to your libs directory. Don't lose this jar, tho. We'll need it later. You'll end up with this:

setup9

  1. Select each .so file you've just copied, open their Properties and set their Build Action to AndroidNativeLibrary.

setup10

  1. Create an Android Bindings Project.

    setup12

    Remember that jar from earlier? Now you need to copy it into the Jars directory and make sure its Build Action is set to EmbeddedJar.

    setup13

    Now reference Bindings project to your main Android project - and you're golden.

    setup14

    And yes. Whole separate project for a single file. Thanks, Xamarin. There is actually a way to do this without creating a Bindings project, but that's up to you to figure out. : - )

Studio setup

FMOD Studio setup process is exactly the same, but you'll need to look into studio instead of core directories. It's also extremely important that ALL your dlls and jar are taken form the same version. FMOD doesn't like version mixup. Foxes don't like version mixup. Nobody does.

If you still have questions, take a look at the Demos project.

Playing some tunes!

So, after you've set everything up, it's time to bop some pops, as kids say these days.

  1. Find a sound file and import it into the Content Pipeline.
  2. Select the sound file and set its Build Action to Copy.

setup11

  1. Include the ChaiFoxes.FMODAudio namespace and paste the following code into your Initialize() method:
FMODManager.Init(FMODMode.CoreAndStudio, "Content");

var sound = CoreSystem.LoadStreamedSound("test.mp3");
var channel = sound.Play();
channel.Looping = true;
  1. Compile and hope that you (and me) did everything right.

You can also check out the incluided Demos project.

Bait-and-switch

As you could notice, there are only two nugets - Desktop and Android. But what if you want to use FMOD in a netstandard library? Since there is no crossplatform core FMOD library, this becomes a problem, right? Well, yeah. First-party C# bindings are made in a way that makes it impossible to extract core API without rewriting literally everything from scratch. I am not willing to do that. So, instead we will use a little trick.

Bait-and switch! :0

We don't have a crossplatform library. But we can fool the project into thinking we have one. Open up your netstandard library's csproj and add this:

<PackageReference Include="ChaiFoxes.FMODAudio.Desktop" Version="2.0.0.0" >
  <PrivateAssets>All</PrivateAssets>
</PackageReference>

But wait, what's this? We are adding a desktop nuget into the crossplatform project? Why?

That's the trick - we aren't actually using it! <PrivateAssets>All</PrivateAssets> makes it so the nuget's dll file is not copied over to the output directory. We are only using this nuget at compile-time - and then switching it to a platform-specific version, which is installed in your platform project.

Hacky? Yes. (:

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 and 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 platforms 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, which is much less permissive than mine.

Demo music is provided by Agrofox and FMOD team.

Also big thanque to StinkBrigade who helped a ton in adding FMOD Studio support.

don't forget to pet your foxes

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].