Sound Manager V2, cool !

In Molokoloco | 19:02 - 26 Feb 2011

Suite à mon billet sur les visualisations musicales… j’ai découvert le “Sound manager V2” une librairie JavaScript/Flash qui permet une gestion avancée des MP3 et autres flux audio…
Cette API est utilisée par les grands noms tels que SoundCloud ou Last.fm … et ceux habitués à jQuery ne devraient pas être désorientés !

 

 

Basic API Features (HTML5, Flash 8*)

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

Shiny Flash 9-only Features (Firefox 4 to come)

  • RTMP / Flash Media Server streaming support (experimental) – see serverURL
  • 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

Javascript Animation + Sound Demos

  1. Interval-based animation (with sound)
  2. Smashable Christmas Lights
  3. JS-DOM “painting” + Sound, V1
  4. JS-DOM “painting” + Sound, V2
  5. Canvas + JS visualization

External demo: A Noisy DOM – part of a Yahoo! User Interface blog post, Enhancing YUI-based Apps with Audio.

:)

 

<!-- include SM2 library -->
<script type="text/javascript" src="/path/to/soundmanager2.js"></script>
<!-- configure it for your use -->
<script type="text/javascript">
soundManager.url = '/path/to/sm2-flash-movies/'; // directory where SM2 .SWFs live
soundManager.useHTML5Audio = true;
soundManager.useFlashBlock = false;
// soundManager.debugMode = false;
 
// onready() + createSound() / ontimeout() methods for success/failure:
soundManager.onready(function() {
  // SM2 has loaded - now you can create and play sounds!
  var mySound = soundManager.createSound({
    id: 'aSound',
    url: '/path/to/an.mp3'
    // onload: [ event handler function object ],
    // other options here..
  });
  mySound.play();
});
 
soundManager.ontimeout(function() {
  // (Optional) Hrmm, SM2 could not start. Show an error, etc.?
});
</script>

 

La suite, les démos, la doc, le code… c’est ici : http://www.schillmania.com/projects/soundmanager2/

 

Home made artworks

MyBookReadR | The RSS Wall | Carousel slider | Fast web start | Try it :)
My latest sources and sheets :
Github sources | Personnal wiki | jsFiddle example | WebDev bookmark

RSS Code tooltips updates

  • An error has occurred; the feed is probably down. Try again later.

RSS Molokoloco's JS fiddles

Recent Comments