README and LICENSE
parent
dbfcd15ca2
commit
d0b26f2898
|
@ -0,0 +1,23 @@
|
||||||
|
FineAudio - An audio subsystem replacement for FNA
|
||||||
|
|
||||||
|
Copyright (c) 2022 Evan Hemsley
|
||||||
|
|
||||||
|
This software is provided 'as-is', without any express or implied warranty.
|
||||||
|
In no event will the authors be held liable for any damages arising from
|
||||||
|
the use of this software.
|
||||||
|
|
||||||
|
Permission is granted to anyone to use this software for any purpose,
|
||||||
|
including commercial applications, and to alter it and redistribute it
|
||||||
|
freely, subject to the following restrictions:
|
||||||
|
|
||||||
|
1. The origin of this software must not be misrepresented; you must not
|
||||||
|
claim that you wrote the original software. If you use this software in a
|
||||||
|
product, an acknowledgment in the product documentation would be
|
||||||
|
appreciated but is not required.
|
||||||
|
|
||||||
|
2. Altered source versions must be plainly marked as such, and must not be
|
||||||
|
misrepresented as being the original software.
|
||||||
|
|
||||||
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
|
|
||||||
|
Evan "cosmonaut" Hemsley <evan@moonside.games>
|
|
@ -0,0 +1,40 @@
|
||||||
|
This is FineAudio, a replacement for FNA's Audio subsystem.
|
||||||
|
|
||||||
|
About FineAudio
|
||||||
|
----------------
|
||||||
|
FineAudio is basically MoonWorks Audio with an FNA dependency.
|
||||||
|
It intends to deal with some of the missing pieces of XNA audio and make it easier to use.
|
||||||
|
|
||||||
|
Usage
|
||||||
|
-----
|
||||||
|
Create the AudioDevice:
|
||||||
|
|
||||||
|
```cs
|
||||||
|
AudioDevice = new FineAudio.AudioDevice();
|
||||||
|
```
|
||||||
|
|
||||||
|
Load your sound effects and music:
|
||||||
|
```cs
|
||||||
|
StaticSound.Load(AudioSystem, "sword.wav");
|
||||||
|
StreamingSoundOgg.Load(AudioSystem, "my_song.ogg");
|
||||||
|
```
|
||||||
|
|
||||||
|
Sound playback is controlled via sound instances.
|
||||||
|
Streaming sounds are already instances, but static sounds need to have instances created from them.
|
||||||
|
|
||||||
|
```cs
|
||||||
|
var swordSound = StaticSound.LoadWav(AudioSystem, "sword.wav");
|
||||||
|
var swordSoundInstance = swordSound.GetInstance();
|
||||||
|
swordSoundInstance.Play();
|
||||||
|
|
||||||
|
MySong = StreamingSoundOgg.Load(AudioSystem, "my_song.ogg");
|
||||||
|
MySong.Play();
|
||||||
|
```
|
||||||
|
|
||||||
|
You are responsible for managing these instances!
|
||||||
|
If you lose track of sound instances, unpredictable things will happen,
|
||||||
|
like sudden interruption of playback or memory leaks.
|
||||||
|
|
||||||
|
License
|
||||||
|
-------
|
||||||
|
FineAudio is licensed under the zlib license. See LICENSE for details.
|
Loading…
Reference in New Issue