Haxe support for the Opus Audio Codec
This library works on the C++ target only!
haxelib install hxopus
Or through git.
haxelib git hxopus https://github.com/Vortex2Oblivion/hxopus.git
Hxopus provides helper functions for easy playback on some popular game frameworks
// 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();
// 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();
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));
Xiph.org Foundation - Libopus and Opusfile libraries.
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.
Prio - Shockwave Shuffle Song used for testing playback.