JS的語音控制庫:SoundManager2

jopen 9年前發布 | 29K 次閱讀 JavaScript開發 SoundManager2

SoundManager2 是一個 JavaScript 語音 API,對HTML5 和 Flash Audio APIs進行了封裝和擴展。 支持MP3, MPEG4 和HTML5 audio + (experimental) RTMP。它為JavaScript提供了可靠的跨瀏覽器的語音控制,體積很小,只有 11KB 左右。

HTML5 Audio() Support

* 100% Flash-free MP3 + MP4/AAC where supported
* Compatible with Apple iPad 3.2, iPhone/iOS 4 and newer
* Fallback to Flash for MP3/MP4 support, as needed
* SM2 API is transparent; HTML5/flash switching handled internally
* HTML5 API support approximates Flash 8 API features
* Some other formats (WAV/OGG) supported via HTML5, depending on browser
* See "useHTML5Audio" property 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:

* Songza
* Earbits
* freesound.org
* last.fm
* 8tracks
* Discogs
* The Hype Machine
* nyan.cat
* AudioGalaxy


項目主頁:http://www.baiduhome.net/lib/view/home/1423983380984

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!