Skip to content

Releases: EvandroLG/ts-audio

ts-audio v0.7.4

31 Jan 20:00
Compare
Choose a tag to compare

ts-audio

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

What's new?

  • Reduced package size from 2.2kB to 1.6kB (Gzipped)
  • Added support to CommonJS and UMD bundles

Full Changelog: v0.7.2...v0.7.4

ts-audio v0.7.2

29 Nov 10:44
Compare
Choose a tag to compare

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`

ts-audio v0.7.1

07 Aug 09:08
Compare
Choose a tag to compare

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

What's new?

  • audio.audioCtx: AudioContext
    Returns AudioContext object as read-only property

  • playlist.audioCtx: AudioContext
    Returns AudioContext object as read-only property from the currently playing audio

ts-audio v0.7.0

30 Mar 20:00
Compare
Choose a tag to compare

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

What's new?

  • Updated the AudioPlaylist component adding a new method:

    • playlist.toggle(): void
      Plays or pause the current audio
  • Updated the Audio component adding a new method:

    • audio.toggle(): void
      Plays or pause the current audio
  • Improved the preload solution performance

  • Improved unit tests

ts-audio v0.6.1

14 Dec 12:43
Compare
Choose a tag to compare

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

What's new?

  • Updated the AudioPlaylist component adding two new parameters:

    • preload?: boolean (false by default)
      Load the files before the play method is called

    • preloadLimit?: number (3 by default)
      Defines the maximum number of files that will be requested concurrently

  • Updated the Audio component adding a new parameter:

    • preload?: boolean (false by default)
      Load the files before the play method is called
  • Improved types

  • Improved unit tests

ts-audio v0.6.0

05 Aug 11:24
Compare
Choose a tag to compare

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

What's new?

  • Fixed bug on AudioPlaylist looping logic
  • Improved types

ts-audio v0.5.0

02 Jun 17:18
Compare
Choose a tag to compare

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

What's new?

  • Updated AudioPlaylist component adding a new optional parameter:

    • shuffle?: boolean (false by default)
      Shuffles the order of all files passed by parameter before playing them.
  • Complete example

ts-audio v0.4.7

05 Mar 22:45
Compare
Choose a tag to compare

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

What's new?

  • Updated AudioPlaylist component adding two new methods:

    • playlist.next(): void
      Stops the current audio and starts playing the next one based in the list provided in the AudioPlaylist instance. In case the current audio
      is the last in the list, it starts playing the first one.

    • playlist.prev(): void
      Stops the current audio and starts playing the previous one based in the list provided in the AudioPlaylist instance. In case the current
      audio is the first in the list, it starts playing the last one.

  • Complete example

ts-audio v0.4.5

30 Oct 21:58
Compare
Choose a tag to compare

ts-audio is an agnostic and easy-to-use library to work with the AudioContext API.

What's new?

  • Added logic to play the audio multiple times using the same object
  • Fixed bug that played the playlist always in loop
  • Refactored code

ts-audio v0.4.2

26 Jul 21:11
Compare
Choose a tag to compare

ts-audio is an agnostic and easy-to-use library to work with the AudioContext API.

What's new?

import { AudioPlaylist } from 'ts-audio';

const playlist = AudioPlaylist({
  files: ['./songOne.mp3', './songTwo.mp3', './songThree.mp3'],
  volume: 0.7,
  loop: true
});

playlist.play();
playlist.volume; // 0.7
playlist.volume = 05