rexit

Rexit - a small audio toolkit for luxe. It bases on luxe's API and contains everything to be useful for rapid prototyping games.
https://github.com/PursuitDream/Rexit

To install, run:

haxelib install rexit 1.1.2 

See using Haxelib in Haxelib documentation for more information.

README.md

Rexit

RexitLogo

Rexit - a small audio toolkit for luxe. It bases on luxe's API and contains everything to be useful for rapid prototyping games.

What is that?

I hate unnecessary difficulties in luxe's audio handles, resources and etc. In different experiments with them I concluded that it's inconvenient and it takes away a lot of free time. In the internet there a lot of different interesting audio libraries for JavaScript or Haxe and I decided to put together all this ideas into the Rexit.

Install

Just be sure that you have installed git and write this line in your command prompt.

haxelib git rexit https://github.com/PursuitDream/Rexit.git

Example

And there is my example for Rexit:

Rexit.create({
	sounds: [
		{
			name: "assets/audio.ogg",
			fadein: false
		},
		{
			name: "sound1",	//"assets/sound1.ogg", Rexit searches full path by name
			overlay: false,
			onComplete: function()
			{
				trace("OK!");
			},
			volume: 0.8
		}
	],
	fade: true
});

Rexit.play("sound1");
Rexit.play("assets/audio.ogg");

Tutorial

Maybe sound's creating looks so bulky, but what if I show you, that there is no necessary to do this? You can just play sound without initialization or preloading it in the game! Just play it!

Rexit.play("assets/sound2.wav", { fadein: true, fadeout: true });

As you see, the second argument is an anonymous object or options object. There you can change sound's properties.

Sounds options

Let's consider more in detail.

  • name:String - sound's ID or path to audio file;
  • volume:String = 0 - sound's volume;
  • loop:Bool = false - playing loop sound;
  • overlay:Bool = false - if it true, Rexit stops the last instance of the sound and plays the new;
  • fadein:Bool = false - audio animation starts in the beginning of the sound playing;
  • fadeout:Bool = false - audio animation starts in the end of the sound playing;
  • duration:Bool = 1 - duration (in seconds) of fading;
  • onComplete:Void->Void - function is played after the end sound playing;
  • onFade:Void->Void - it's played at the moment of sound's fading;
  • pitch:Float = 1 - sound's pitch;
  • pan:Float = 0 - sound's pan;

For russian speakers I have made documentation there: link

Contributors
CamperPR
PursuitDream
Version
1.1.2
Published
1 year ago
License
MIT

All libraries are free

Every month, more than thousand developers use haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on Github!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on Github