Releases: EvandroLG/ts-audio
ts-audio v0.8.0
ts-audio is a lightweight, agnostic library that makes it easy to work with AudioContext and build audio playlists in the browser.
What's new?
Audio: AddisPlayinggetter to check playback state (thanks, @stricoff92!)- Tooling: Migrate the entire project from Node to Bun (tests, scripts, demos, CI/CD)
- Tooling: Upgrade ESLint to v9 and Husky to v9
ts-audio v0.8.0
ts-audio is a lightweight, agnostic library that makes it easy to work with AudioContext and build audio playlists in the browser.
What's new?
Audio: Implementdestroy()method for proper resource cleanup and memory managementAudioPlaylist: Implementdestroy()method for proper resource cleanup and memory managementAudio: Enhancedseek()reliability - now works consistently before and after playback starts
Destroy method example
import { Audio } from 'ts-audio'
const audio = Audio({
file: 'path/to/audio.mp3',
volume: 1,
loop: false
})
audio.play()
// When you're done with the audio instance, clean up resources
audio.destroy()
// The destroy method will:
// - Stop playback
// - Disconnect audio nodes
// - Remove all event listeners
// - Release references for garbage collectionts-audio v0.7.9
ts-audio is a lightweight, agnostic library that makes it easy to work with AudioContext and build audio playlists in the browser.
What's new?
Audio: Implementseek()method for precise playback positioningAudio: EnhancedcurrentTimetracking with more accurate timing calculationsDocumentation:README.mdimprovements with better examples and usage guidanceCI/CD: Improved pipeline with automated branch cleanup and enhanced workflow
New Seek Method Example
import { Audio } from 'ts-audio'
const audio = Audio({
file: 'path/to/audio.mp3',
volume: 1,
loop: false
})
audio.play()
// Jump to 30 seconds into the track
audio.seek(30)
// Get current playback position
console.log(audio.currentTime) // Returns precise current time
console.log(audio.duration) // Returns total track durationThe new seek() method allows developers to programmatically jump to any point in an audio file, while the improved currentTime tracking provides more precise timing information for better audio control.
Full Changelog: v0.7.8...v0.7.9
ts-audio v0.7.8
ts-audio v0.7.7
ts-audio v0.7.6
ts-audio v0.7.5
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
EventEmitterandEventHandlerto use a class-based structure - Updated
ESlintrules to force consistent type imports and order imports per groups - Updated
PrettierandTypeScriptto align with modern standard
ts-audio v0.7.4
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
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
AudioandAudioPlaylistmodules - Updated the
AudioPlaylistmodule 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
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