Skip to content

ts-audio v0.7.2

Compare
Choose a tag to compare
@EvandroLG EvandroLG released this 29 Nov 10:44
· 80 commits to master since this release

ts-audio is an agnostic library that makes it easy to work with AudioContext and create audio playlists in the browser.

What's new?

  • Refactored out both Audio and AudioPlaylist modules
  • Updated the AudioPlaylist module adding logic to support weighted files.
    • Note: If you pass files with a weighted structure, the playlist will be played in a loop and shuffled.
import { AudioPlaylist } from 'ts-audio';
import songOne from './1.mp3';
import songTwo from './2.mp3';
import songThree from './3.mp3'; 

const playlist = AudioPlaylist({
 files: { [songOne]: 1, [songTwo]: 5, [songThree]: 1 },
});

playlist.play(); // `songTwo` will play five times more often than `songOne` and `songTree`