Giter Club home page Giter Club logo

ane-sounds's Introduction

ANE-Sounds

A simple ANE (Air Native Extension) to play sounds on Android.

Overview

Adobe's Air platform has difficulty playing sounds correctly on Android devices. The sounds are often delayed or do not play at all. This extension is designed to fix these issues and play short sound effects.

Future Plans

Right now this extension is very basic and only works on Android. The goal is to eventually re-write the extension to extend Air's Sound class and provide the same functionality. We would also like to support iOS devices in the future as well, since we have experienced some sound issues on iOS as well.

Usage

You can grab the ANE from the /bin folder of the repo or on the releases page of the repo.

After including the ANE in your project you'll need to reference a sound with a File object. The sound file can be embedded into your application or downloaded to an external directory. The extension can play mp3, wav or ogg files.

Load the sound using the ANE:

var soundFile:File = File.applicationDirectory.resolvePath("click-sound.ogg");
var soundId:int = ANESounds.instance.loadSound(soundFile);

Now you can play the sound using the soundId that was returned:

ANESounds.instance.playSound(soundId);

The extension also supports more advanced playback options:

ANESounds.instance.playSound(soundId:int, leftVolume:Number = 1.0, rightVolume:Number = 1.0, loop:int = 0, playbackRate:int = 1.0);

Multiple Platforms

Since the extension only works for Android right now, you'll want to use the native AIR Sound class for playing sounds on other platforms.

if(ANESounds.isSupported())
{
	ANESounds.instance.playSound(1);
}
else
{
	// Use another method to play sounds
}

Changelog

v1.0 (01/04/2015)

  • Added the ability to play sounds stored in any location using a File object

ane-sounds's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.