Dida.js
An audio stream blender for the browser.
Install
Install with npm
$ npm install dida.js
Or install with yarn
$ yarn add dida.js
;
Or umd builds are also available
Will expose the global variable to window.Dida
.
Usage
const dida = // Default volume volume: 07 // Whether to cache the played audio data cache: true // Audio segment size chunk: 64 * 1024 // Maximum time difference between audio and video synchronization maxTimeDiff: 200 // Whether to automatically terminate the audio stream autoEnd: true // Automatically terminate the audio stream autoEndTime: 5000 // Activate audio after trying to touch the screen on the mobile touchResume: true // Time stamp calibration can be returned when preparing to play the next audio segment t // When loading into an audio stream null // Stop playing null // When starting to play null // When terminating loading null // When destroyed null // When audio segmentation decoding is completed null // When decoding is wrong null // When the volume changes null // When freeing memory null;
Api
// getter and setter of the volume from 0 to 1;didavolume; // Load a Uint8Array and a corresponding timestampdida; // Manually terminate loadingdida; // Play by the specified timestampdida; // Stop playdida;
License
MIT © Harvey Zack