hxopus

Support for decoding and playing the opus audio format in haxe.
https://github.com/Vortex2Oblivion/hxopus

To install, run:

haxelib install hxopus 1.0.0 

See using Haxelib in Haxelib documentation for more information.

README.md

Haxe support for the Opus Audio Codec

This library works on the C++ target only!

Installation

haxelib install hxopus

Or through git.

haxelib git hxopus https://github.com/Vortex2Oblivion/hxopus.git

Usage

Hxopus provides helper functions for easy playback on some popular game frameworks

OpenFL

// Passing the filename in directly.
var sound:Sound = Opus.toOpenFL("path/to/your/sound.opus");
sound.play();

// Or with the raw bytes
var sound:Sound = Opus.toOpenFL(Assets.getBytes("path/to/your/sound.opus"));
sound.play();

Flixel


// Passing the filename in directly.
var sound:FlxSound = Opus.toFlxSound("path/to/your/sound.opus");
sound.play();

// Or with the raw bytes
var sound:FlxSound = Opus.toFlxSound(Assets.getBytes("path/to/your/sound.opus"));
sound.play();'

Other

If you are using another framework you will have to support it yourself. However Hxopus provides helper functions for decoding the audio file and getting the bytes,

Bytes.ofData(Opus.getDecodedBytes(bytes:Bytes));

Credits

Xiph.org Foundation - Libopus and Opusfile libraries.

Gian-Carlo Pascutto - Libogg.

Cherry - CherryAudio used for decoding the opus files and helping me optimize the opus loader.

Carlos Ballesteros Velasco - OpenFL-Opus Referenced a lot when making the ndll for hxopus.

Contributors
Vortex
Version
1.0.0
Published
2 months ago
License
MIT

All libraries are free

Every month, more than a 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