GithubHelp home page GithubHelp logo

happy-ferret / dynamicaudio.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bfirsh/dynamicaudio.js

0.0 2.0 0.0 24 KB

An interface for the Web Audio API with a Flash shim for older browsers

License: Other

JavaScript 89.52% HTML 4.50% ActionScript 5.98%

dynamicaudio.js's Introduction

dynamicaudio.js

An interface for the Web Audio API with a Flash shim for older browsers.

Download it from the releases page.

For a basic example, see demo.html.

Usage

First, instantiate a DynamicAudio object with a dictionary of options:

var dynamicaudio = new DynamicAudio({'swf': '/static/dynamicaudio.swf'})

The swf option specifies the path of the dynamicaudio.swf file relative to the page being displayed.

The DynamicAudio object has two methods available on it:

write(samples)

Plays an array of floating point audio samples in the range -1.0 to 1.0.

They are output as 2 channels at 44.1 KHz. This means it takes 88,200 samples to play 1 second of audio. You do not need to supply this many samples in a single call, but if you don't call write() often enough with enough samples, you will get buffer underruns.

writeInt(samples)

This method is the same as write(), but is instead supplied with integer samples in the range -32,768 to 32,767. If your samples are already integers, this method is more efficient.

Build from source

To build, you will need jake:

$ sudo gem install jake

You will also need Adobe's Flex SDK. This should be placed in a flexsdk directory in the same directory as jake.yml.

Now run:

$ jake

dynamicaudio.js's People

Contributors

bfirsh avatar

Watchers

James Cloos avatar  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.