Q audiopicker Class
jQuery plugin that allows to create or upload an audio file to the server. Works on various platforms (desktop and mobile etc) in similar way. Should be applied to element like this $('#someimg').plugin('Q/audio', options).
options is an Object that contains parameters for function
url is a url to post to.
Can be a URL path or a function returning a URL path. It must exist on the server.
[subpath=""]String | Function optional
A subpath which may be created on the server if it doesn't already exist. If this is a function, it is executed right before the request is sent.
preprocess is a function which is triggering before file upload. Its "this" object will be a jQuery of the audiopicker element The first parameter is a callback, which should be called with an optional hash of overrides, which can include "data", "path", "subpath", "save", "url", "loader"
onSuccess is Q.Event which is called on successful upload. First parameter will be the server response.
onError Q.Event which is called if upload failed.
onFinish Q.Event which is called at the end, whatever the outcome.
Process file uploading
Format record time elapsed
Time elapsed in seconds
Pause audio and detect promise event on mobile devices
Set the audio
Play audio and detect promise event on mobile devices
Handle recorder states
New recorder state
Removes the Q/audio functionality from the element
Start audio creation dialog