T("audio.jsonp")
ARSTEREO Audio from jsonp
Installation
Download an extra object: audio-jsonp.js
Description
T("audio.jsonp")
is an instance of T("buffer")
that reads an audio file via JSONP.
_callback
of the query string (begin with an underscore) in the URL is removed before sending request. It is useful when you want to use such as static files with Dropbox. For example, url "../base64_drum.js?_callback=drum"
is converted "../base64_drum.js"
, _callback=drum
is used as a part of callback function name, (ex: window.timbrejs_audiojsonp_drum
.)
Properties
isLoaded
(ReadOnly Boolean)- Returns
true
if the receiver have loaded an audio file.
- Returns
Methods
- DEFERRED
load(url, [done], [fail])
- Loads an audio file and decodes it and returns a
promise
object as jQuery.
- Loads an audio file and decodes it and returns a
loadthis(src, [done], [fail])
- Same as
load()
, but returnsthis
.
- Same as
JSONP
sample(large file): https://dl.dropbox.com/u/645229/tmp/timbre.js/base64_drum.js
Tool
convert an audio file to a JSONP script
Source
https://github.com/mohayonao/timbre.js/blob/master/src/extras/audio-jsonp.js