Git Product home page Git Product logo

soundmanager2's Introduction

SoundManager 2: JavaScript Sound for the Web

By wrapping and extending HTML5 and Flash Audio APIs, SoundManager 2 brings reliable cross-platform audio to JavaScript.

HTML5 Audio() Support (Beta-ish)

* 100% Flash-free MP3 + MP4/AAC where supported, compatible with Apple iPad 3.2, iPhone/iOS 4
* Fallback to Flash for MP3/MP4 support, as needed
* SM2 API is unchanged, transparent; HTML5/flash switching handled internally
* HTML5 API support approximates Flash 8 API features, minus ID3, plus buffering
* Some other formats (WAV/OGG) supported via HTML5, depending on browser
* See soundManager.useHTML5Audio for implementation details.

Basic API Features (Flash 8)

* Load, stop, play, pause, mute, seek, pan and volume control of sounds from Javascript
* Events: onload, whileloading, whileplaying, onfinish and more
* ID3V1 and ID3V2 tag support for MP3s (title, artist, genre etc.)

Shiny Flash 9 Features

* RTMP / Flash Media Server streaming support (new, experimental)
* MPEG-4 (AAC, HE-AAC, H.264) audio support
* "MultiShot" play (layered/chorusing effects)
* Waveform/frequency spectrum data
* Peak (L/R channel volume) data
* Audio buffering state/event handling

General Tech Stuff

* Full API Documentation with examples and notes
* console.log()-style debug output and troubleshooting tools
* Community-based discussion/support

As heard on The Internets

A few nifty sites that have implemented SM2 for driving audio:

* Muxtape
* SoundCloud / The Cloud Player
* 8tracks
* Last.fm
* Opera (media player component)
* Discogs
* Mixcrate

Project home, documentation, live demos etc.:

www.schillmania.com/projects/soundmanager2/

Merged fork ( kjvarga: github.com/kjvarga/SoundManager2/ )

This SM2 fork contains the SoundManager2 implementation that is used on www.kazaa.com.

We added RTMP support to SM2 which is now part of the SM2 (experimental) branch as of V2.96a.20100606.

Downloads: www.schillmania.com/projects/soundmanager2/doc/download/

For more background on the addition of RTMP check out getsatisfaction.com/schillmania/topics/soundmanager_doesnt_support_rtmp

Our old branch of development has been moved to github.com/kjvarga/SoundManager2/tree/pre_merge.

Changes

In addition to the documented SM2 options, we have added the following.

New options to SM2:

  • ondebuglog callback called with every debugging message. Useful if you need to programatically have access to the debug logs. We use this in our automated reporting of stream failures for QA.

New options to createSound:

  • bufferTimes optional array of buffer times for double/multiple-buffering. Just specify an array of incrementing buffer sizes (in seconds) e.g. [0.5, 2, 8] for a half-second, then 2 second, then 8 second buffer. Buffers increment when full and reset to the smallest buffer when empty, or when starting to play an unbuffered portion of the stream.

  • onstats callback called with statistics including how long it took to connect to the server, and how long it took to play (useful for QA).

Our FMS server has some peculiarities that we have to deal with:

  • bytesLoaded is always 0 for a streaming sound

  • NetStream.Play.Stop is sent when it shouldn’t

  • We cannot get the stream length using a typical getStreamLength call

  • We cannot get bandwidth information

Debugging

  1. Set soundManager.debugFlash = true;

  2. Use a debug version of the SWF e.g. soundmanager2_flash9_debug.swf

  3. Open the Flash IDE. Open the SM2 source code files. Start a remote debugging session.

  4. Refresh the application in the browser (make sure caching is off).

  5. The SWF should connect to Flash and allow you to step through the source.

If it doesn’t:

  1. Make sure that the Flash version you have installed supports debugging

  2. Make sure that the Flash debugger application is using the same version of Flash.

SM2

Project home, documentation, live demos etc.: www.schillmania.com/projects/soundmanager2/

soundmanager2's People

Contributors

kjvarga avatar

Stargazers

Mark John Buenconsejo avatar

Watchers

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