Comprehensive audio library with progressive streaming, recording capabilities, real-time processing, and intelligent caching for web applications
npm install audio.libx.js


A comprehensive audio library for web browsers that provides both progressive streaming playback and advanced recording capabilities, with intelligent caching and real-time audio processing.
``bash`
npm install audio.libx.js
typescript
import { createAudioStreamer } from 'audio.libx.js';// Get your audio element
const audioElement = document.getElementById('audio') as HTMLAudioElement;
// Create streamer with options
const streamer = createAudioStreamer(audioElement, {
bufferThreshold: 5, // Start playing after 5 seconds buffered
enableCaching: true, // Enable persistent caching
enableTrimming: true // Enable silence trimming
});
// Stream audio from URL
try {
const result = await streamer.streamFromUrl('https://example.com/audio.mp3');
// Wait for audio to be ready
await result.onLoaded;
console.log('Audio is ready to play!');
// Wait for playback to complete
await result.onEnded;
console.log('Playback finished!');
} catch (error) {
console.error('Streaming failed:', error);
}
`$3
`typescript
import { createAudioRecorder } from 'audio.libx.js';// Create recorder with options
const recorder = createAudioRecorder({
mimeType: 'audio/webm;codecs=opus',
audioBitsPerSecond: 128000,
enableRealtimeProcessing: true
});
// Set up event listeners
recorder.on('recordingStarted', (event) => {
console.log('Recording started:', event.recordingId);
});
recorder.on('audioLevel', (event) => {
console.log('Audio level:', event.data);
});
recorder.on('recordingCompleted', (event) => {
console.log('Recording completed:', event.data);
// event.data contains the recorded audio blob
});
// Start recording
try {
const recording = await recorder.startRecording();
// Wait for recording to start
await recording.onStarted;
console.log('Recording is active!');
// Stop recording after some time or user action
const recordedData = await recording.stop();
console.log('Recording finished:', recordedData);
} catch (error) {
console.error('Recording failed:', error);
}
`$3
`typescript
import { createPlaylistManager } from 'audio.libx.js';// Get your audio element
const audioElement = document.getElementById('audio') as HTMLAudioElement;
// Create playlist manager
const playlistManager = createPlaylistManager(audioElement, {
audioStreamerOptions: {
enableCaching: true,
enableTrimming: false
}
});
// Load playlist from URLs or track objects
const tracks = [
'https://example.com/track1.mp3',
'https://example.com/track2.mp3',
{
id: 'track3',
url: 'https://example.com/track3.mp3',
title: 'My Favorite Song',
duration: 210
}
];
playlistManager.loadPlaylist(tracks);
// Set up event listeners
playlistManager.on('trackChanged', (event) => {
console.log('Now playing:', event.data.track.title);
});
playlistManager.on('playlistEnded', () => {
console.log('Playlist finished!');
});
// Control playback
await playlistManager.initialize();
await playlistManager.play(); // Play current track
await playlistManager.next(); // Next track
await playlistManager.previous(); // Previous track
playlistManager.pause(); // Pause
playlistManager.setPlayMode('repeat'); // Set repeat mode
playlistManager.toggleShuffle(); // Enable/disable shuffle
// Manage tracks
playlistManager.addTrack('https://example.com/new-track.mp3');
playlistManager.removeTrack(1);
playlistManager.clearPlaylist();
`$3
`typescript
import { createPlaylistManager, createMediaSessionManager } from 'audio.libx.js';// Setup audio and playlist
const audioElement = document.getElementById('audio') as HTMLAudioElement;
const playlist = createPlaylistManager(audioElement, {
audioStreamerOptions: {
useNativeStreaming: true // Better for mobile background playback
}
});
// Create media session manager for lock screen controls
const mediaSession = createMediaSessionManager({
seekBackwardOffset: 10, // 10 seconds back
seekForwardOffset: 10, // 10 seconds forward
autoUpdatePosition: true // Auto-sync with audio element
});
// Connect to audio element for auto-sync
mediaSession.connectAudioElement(audioElement);
// Update metadata when track changes
playlist.on('trackChanged', (event) => {
const track = event.data.track;
mediaSession.updateMetadata({
title: track.title,
artist: track.artist || 'Unknown Artist',
album: track.album || 'Unknown Album',
artwork: [
{ src: track.artwork, sizes: '512x512', type: 'image/jpeg' }
]
});
});
// Setup playback callbacks for system controls
mediaSession.updateCallbacks({
onPlay: async () => await playlist.play(),
onPause: () => playlist.pause(),
onSeek: (time) => audioElement.currentTime = time,
onPreviousTrack: () => playlist.previous(),
onNextTrack: () => playlist.next(),
});
// That's it! Now you get:
// ✅ Lock screen controls on iOS/Android
// ✅ Background playback support
// ✅ Bluetooth/AirPods controls
// ✅ Browser media controls on desktop
// ✅ Automatic position state updates
`$3
`typescript
import { createSoundEffectsManager } from 'audio.libx.js';// Create sound effects manager
const soundEffects = createSoundEffectsManager({
enableCaching: true,
maxConcurrentSounds: 8,
defaultVolume: 1.0
});
// Define sound effect keys (can use enums for better DX)
enum SoundEffect {
CLICK = 'click',
BEEP = 'beep',
SUCCESS = 'success',
ERROR = 'error'
}
// Register sound effects
soundEffects.registerSound(SoundEffect.CLICK, 'https://example.com/click.wav');
soundEffects.registerSound(SoundEffect.BEEP, 'https://example.com/beep.wav');
soundEffects.registerSound(SoundEffect.SUCCESS, 'https://example.com/success.wav', {
volume: 0.8,
preload: true
});
// Or register multiple at once
soundEffects.registerSounds([
{ key: 'coin', url: 'https://example.com/coin.wav' },
{ key: 'jump', url: 'https://example.com/jump.wav' },
]);
// Play sound effects
await soundEffects.initialize();
await soundEffects.playSound(SoundEffect.CLICK);
await soundEffects.playSound('coin', { volume: 0.5, loop: false });
// Control volume
soundEffects.setVolume(SoundEffect.BEEP, 0.3);
// Preload for instant playback
await soundEffects.preloadAllSounds();
// Event listeners
soundEffects.on('soundPlayed', (event) => {
console.log('Playing:', event.data.key);
});
soundEffects.on('autoplayBlocked', (event) => {
console.log('Autoplay blocked for:', event.data.key);
// Handle user interaction requirement
});
`$3
`typescript
import { createAudioRecorder } from 'audio.libx.js';// Create recorder with real-time chunk streaming
const recorder = createAudioRecorder({
enableRealtimeChunks: true,
chunkInterval: 500, // Send chunks every 500ms
chunkFormat: 'wav', // Format: 'raw', 'pcm', 'wav', or 'webm'
chunkSampleRate: 16000, // Target sample rate (ideal for STT)
chunkChannels: 1 // Mono audio
});
// Set up chunk callback for real-time processing
recorder.onAudioChunk((chunk) => {
console.log('Received chunk:', {
format: chunk.format,
sampleRate: chunk.sampleRate,
size: chunk.data.byteLength,
timestamp: chunk.timestamp,
duration: chunk.duration
});
// Send to speech-to-text service
websocket.send(chunk.data);
});
// Start recording
const recording = await recorder.startRecording();
await recording.onStarted;
// Chunks will be sent automatically via the callback
// Stop when done
const finalRecording = await recording.stop();
`$3
`typescript
import { createAudioContextManager } from 'audio.libx.js';// Create audio context manager
const contextManager = createAudioContextManager({
sampleRate: 44100,
latencyHint: 'interactive',
autoUnlock: true // Automatically unlock on first user gesture
});
// Check if unlock is needed (mobile platforms)
if (contextManager.needsUnlock()) {
console.log('Audio needs user interaction to unlock');
// Get platform-specific guidance
const guidance = contextManager.getPlatformGuidance();
guidance.forEach(msg => console.log(msg));
}
// Manually unlock on user interaction
button.addEventListener('click', async () => {
const unlocked = await contextManager.ensureUnlocked();
if (unlocked) {
console.log('Audio context unlocked and ready!');
}
});
// Or register auto-unlock
contextManager.registerAutoUnlock();
// Get current state
const state = contextManager.getState();
console.log('Platform:', state.platform); // 'ios', 'android', 'desktop', 'safari'
console.log('Is locked:', state.isLocked);
console.log('Context state:', state.contextState);
// Get the audio context for use
const audioContext = contextManager.getContext();
// Cleanup when done
await contextManager.dispose();
`$3
`typescript
import { AudioCache } from 'audio.libx.js';const cache = new AudioCache('my-app-cache', 'audio-store');
await cache.initialize();
// Store with tags and custom metadata
await cache.set('audio-123', audioChunks, 'audio/mpeg', {
tags: ['tts', 'user:john', 'language:en'],
customData: {
speaker: 'john',
voice: 'alloy',
text: 'Hello world',
duration: 2.5
}
});
// Query by tag
const ttsAudios = await cache.getByTag('tts');
const johnAudios = await cache.getByTag('user:john');
console.log(
Found ${ttsAudios.length} TTS audios);// Advanced cleanup with filters
const deletedCount = await cache.cleanup({
maxAge: 7 24 60 60 1000, // 7 days
maxEntries: 100, // Keep max 100 entries
minAccessCount: 2, // Delete if accessed less than 2 times
tags: ['tts'], // Only cleanup TTS audios
excludeTags: ['favorite'] // But keep favorites
});
console.log(
Cleaned up ${deletedCount} entries);// Get statistics with tag breakdown
const stats = await cache.getStats();
console.log('Total entries:', stats.entryCount);
console.log('Total size:', stats.totalSize);
console.log('By tag:', stats.byTag);
// { tts: { count: 50, size: 1024000 }, 'user:john': { count: 20, size: 512000 } }
// Clear by tag
await cache.clearByTag('user:john');
`🔧 API Reference
$3
The main class for audio streaming operations.
#### Constructor
`typescript
const streamer = new AudioStreamer(audioElement: HTMLAudioElement, options?: AudioStreamerOptions);
`#### Methods
#####
streamFromUrl(url: string, audioId?: string): PromiseStream audio from a URL with automatic caching.
`typescript
const result = await streamer.streamFromUrl('https://example.com/track.mp3');
await result.onLoaded; // Audio ready to play
await result.onEnded; // Playback complete
`#####
streamFromResponse(response: Response, audioId?: string): PromiseStream audio from a fetch Response object.
`typescript
const response = await fetch('/api/audio/track');
const result = await streamer.streamFromResponse(response);
`#####
playFromCache(audioId: string): PromisePlay previously cached audio by ID.
`typescript
const result = await streamer.playFromCache('my-audio-id');
`#####
initialize(): PromiseInitialize the streamer (called automatically on first use).
#####
getState(): StreamingStateGet current streaming state.
`typescript
const state = streamer.getState();
console.log(state.state); // 'idle', 'loading', 'streaming', 'playing', etc.
`#####
getCacheStats(): PromiseGet cache statistics.
`typescript
const stats = await streamer.getCacheStats();
console.log(Cache size: ${stats.totalSize} bytes);
console.log(Hit ratio: ${stats.hitRatio * 100}%);
`#####
clearCache(): PromiseClear all cached audio.
#####
dispose(): voidClean up resources and event listeners.
$3
The main class for audio recording operations.
#### Constructor
`typescript
const recorder = new AudioRecorder(options?: AudioRecorderOptions);
`#### Methods
#####
startRecording(recordingId?: string): PromiseStart recording audio with automatic permission handling.
`typescript
const recording = await recorder.startRecording();
await recording.onStarted; // Recording active
const data = await recording.stop(); // Stop and get data
`#####
stopRecording(): PromiseStop current recording and return the recorded data.
`typescript
const recordedData = await recorder.stopRecording();
console.log('Duration:', recordedData.duration);
console.log('Size:', recordedData.blob.size);
`#####
pauseRecording(): voidPause current recording (if supported by browser).
#####
resumeRecording(): voidResume paused recording (if supported by browser).
#####
cancelRecording(): voidCancel current recording and discard data.
#####
getState(): RecordingStateGet current recording state.
`typescript
const state = recorder.getState();
console.log('State:', state.state); // 'idle', 'recording', 'paused', etc.
console.log('Duration:', state.duration);
console.log('Has permission:', state.hasPermission);
`#####
getCapabilities()Get recorder capabilities and supported formats.
`typescript
const caps = recorder.getCapabilities();
console.log('Supported MIME types:', caps.supportedMimeTypes);
console.log('Can pause:', caps.canPause);
`#### Events
Subscribe to recording events:
`typescript
recorder.on('permissionRequested', (event) => {
console.log('Requesting permission...');
});recorder.on('recordingStarted', (event) => {
console.log('Recording started:', event.recordingId);
});
recorder.on('audioLevel', (event) => {
console.log('Audio level:', event.data);
});
recorder.on('durationUpdate', (event) => {
console.log('Duration:', event.data, 'ms');
});
recorder.on('recordingError', (event) => {
console.error('Recording error:', event.data);
});
`Available events:
-
permissionRequested - Permission request started
- permissionGranted - Permission granted
- permissionDenied - Permission denied
- recordingStarted - Recording started
- recordingPaused - Recording paused
- recordingResumed - Recording resumed
- recordingStopped - Recording stopped
- recordingCompleted - Recording completed with data
- recordingCancelled - Recording cancelled
- audioLevel - Real-time audio level updates
- durationUpdate - Recording duration updates
- recordingError - Error occurred$3
Singleton class for managing microphone permissions.
#### Methods
#####
PermissionManager.getInstance(): PermissionManagerGet the singleton instance.
#####
requestPermission(constraints?: MediaConstraintsOptions): PromiseRequest microphone permission with optional constraints.
`typescript
const permissionManager = PermissionManager.getInstance();
const result = await permissionManager.requestPermission({
echoCancellation: true,
noiseSuppression: true,
autoGainControl: true
});if (result.granted) {
console.log('Permission granted!');
// result.stream contains the MediaStream
} else {
console.error('Permission denied:', result.error);
}
`#####
checkPermissionState(): PromiseCheck current permission state without requesting.
#####
testMicrophoneAccess(): PromiseTest microphone access without keeping the stream.
#####
getPermissionErrorGuidance(error: PermissionError): string[]Get user-friendly guidance for permission errors.
#####
getBrowserSpecificGuidance(): string[]Get browser-specific setup instructions.
$3
Real-time audio processing and effects.
#### Constructor
`typescript
const processor = new RealtimeAudioProcessor(options?: RealtimeProcessingOptions);
`#### Methods
#####
initialize(mediaStream: MediaStream): PromiseInitialize processor with a media stream.
#####
startProcessing(): voidStart real-time audio processing.
#####
stopProcessing(): voidStop real-time processing.
#####
onAudioData(callback: (data: RealtimeAudioData) => void): voidSet callback for real-time audio data updates.
`typescript
processor.onAudioData((data) => {
console.log('Audio level:', data.level);
console.log('Is silence:', data.isSilence);
console.log('Sample rate:', data.sampleRate);
});
`#####
setVolume(volume: number): voidAdjust volume (0-2, where 1 is normal).
#####
setFilter(type: BiquadFilterType, frequency: number, Q?: number): voidApply basic EQ filter.
`typescript
processor.setFilter('lowpass', 1000, 1);
`$3
The main class for playlist management and sequential audio playback.
#### Constructor
`typescript
const playlistManager = new PlaylistManager(audioElement: HTMLAudioElement, options?: PlaylistOptions);
`#### Methods
#####
loadPlaylist(items: (string | PlaylistItem)[]): voidLoad a playlist from an array of URLs or track objects.
`typescript
playlistManager.loadPlaylist([
'https://example.com/track1.mp3',
{ id: 'track2', url: 'https://example.com/track2.mp3', title: 'Song Title' }
]);
`#####
playTrack(index: number): PromisePlay a specific track by index.
`typescript
await playlistManager.playTrack(2); // Play third track
`#####
play(): PromisePlay the current track or first track if none selected.
#####
pause(): voidPause the current track.
#####
next(): PromisePlay the next track based on current play mode.
#####
previous(): PromisePlay the previous track.
#####
setPlayMode(mode: 'sequential' | 'repeat' | 'repeatOne'): voidSet the playback mode.
`typescript
playlistManager.setPlayMode('repeat'); // Loop playlist
`#####
toggleShuffle(): voidToggle shuffle mode on/off.
#####
addTrack(item: string | PlaylistItem, index?: number): voidAdd a track to the playlist at optional index.
#####
removeTrack(index: number): PlaylistItem | nullRemove a track from the playlist.
#####
clearPlaylist(): voidClear all tracks from the playlist.
#####
getState(): PlaylistStateGet current playlist state.
`typescript
const state = playlistManager.getState();
console.log('Current track:', state.currentTrack?.title);
console.log('Can play next:', state.canPlayNext);
`#####
getPlaylist(): PlaylistItem[]Get the current playlist as an array.
#####
getCurrentTrack(): PlaylistItem | nullGet the currently playing track.
#####
getCurrentIndex(): numberGet the current track index (-1 if none).
#### Events
Subscribe to playlist events:
`typescript
playlistManager.on('playlistLoaded', (event) => {
console.log('Loaded tracks:', event.data.totalTracks);
});playlistManager.on('trackChanged', (event) => {
console.log('Now playing:', event.data.track.title);
});
playlistManager.on('playStart', (event) => {
console.log('Playback started:', event.data.track.title);
});
playlistManager.on('trackEnded', (event) => {
console.log('Track ended:', event.data.track.title);
});
playlistManager.on('playlistEnded', () => {
console.log('Playlist finished');
});
`Available events:
-
initialized - Manager initialized
- playlistLoaded - Playlist loaded
- playlistCleared - Playlist cleared
- trackAdded - Track added
- trackRemoved - Track removed
- trackChanged - Current track changed
- playStart - Playback started
- pause - Playback paused
- trackEnded - Track ended
- playlistEnded - Playlist ended
- playModeChanged - Play mode changed
- shuffleToggled - Shuffle toggled
- stateChange - State changed
- playError - Playback error$3
The main class for sound effects management with key-based mapping.
#### Constructor
`typescript
const soundEffects = new SoundEffectsManager(options?: SoundEffectOptions);
`#### Methods
#####
registerSound(key: SoundEffectKey, url: string, metadata?: PartialRegister a sound effect with a key.
`typescript
soundEffects.registerSound('click', 'https://example.com/click.wav', {
volume: 0.8,
preload: true,
title: 'Button Click'
});
`#####
registerSounds(sounds: Array<{key, url, metadata?}>): voidRegister multiple sound effects at once.
#####
playSound(key: SoundEffectKey, options?): PromisePlay a sound effect by key with optional overrides.
`typescript
await soundEffects.playSound('click', {
volume: 0.5,
loop: false,
onEnded: () => console.log('Sound finished')
});
`#####
stopSound(key: SoundEffectKey): voidStop all instances of a specific sound effect.
#####
stopAllSounds(): voidStop all currently playing sound effects.
#####
setVolume(key: SoundEffectKey, volume: number): voidSet the default volume for a sound effect (0-1).
#####
removeSound(key: SoundEffectKey): booleanRemove a sound effect from the registry.
#####
clearAllSounds(): voidClear all registered sound effects.
#####
preloadSound(key: SoundEffectKey): PromisePreload a specific sound effect for instant playback.
#####
preloadAllSounds(): PromisePreload all registered sound effects.
#####
getSoundEffect(key: SoundEffectKey): SoundEffectItem | nullGet sound effect information by key.
#####
getAllSoundEffects(): SoundEffectItem[]Get all registered sound effects.
#####
getActiveSounds(): Array<{key, audioElement}>Get currently playing sound effects.
#####
getState(): SoundEffectStateGet current state.
`typescript
const state = soundEffects.getState();
console.log('Active sounds:', state.activeSounds);
console.log('Total registered:', state.totalSounds);
`#####
getCapabilities()Get manager capabilities.
#### Events
Subscribe to sound effect events:
`typescript
soundEffects.on('soundRegistered', (event) => {
console.log('Registered:', event.data.key);
});soundEffects.on('soundPlayed', (event) => {
console.log('Playing:', event.data.key);
});
soundEffects.on('autoplayBlocked', (event) => {
console.log('Autoplay blocked for:', event.data.key);
// Show user interaction prompt
});
`Available events:
-
initialized - Manager initialized
- soundRegistered - Sound registered
- soundRemoved - Sound removed
- soundPlayed - Sound played
- soundStopped - Sound stopped
- soundEnded - Sound ended naturally
- allSoundsStopped - All sounds stopped
- allSoundsCleared - All sounds cleared
- soundPreloaded - Sound preloaded
- preloadError - Preload failed
- volumeChanged - Volume changed
- autoplayBlocked - Autoplay blocked
- playError - Play error
- stateChange - State changed#### Events
Subscribe to streaming events:
`typescript
streamer.on('stateChange', (event) => {
console.log('State changed to:', event.data.state);
});streamer.on('bufferProgress', (event) => {
console.log('Buffer progress:', event.data * 100 + '%');
});
streamer.on('cacheHit', (event) => {
console.log('Cache hit for:', event.audioId);
});
streamer.on('error', (event) => {
console.error('Streaming error:', event.data);
});
`Available events:
-
stateChange - Streaming state changes
- bufferProgress - Buffer loading progress
- canPlay - Audio ready for playback
- loadStart - Loading started
- loadEnd - Loading completed
- playStart - Playback started
- playEnd - Playback ended
- error - Error occurred
- cacheHit - Audio found in cache
- cacheMiss - Audio not in cache$3
`typescript
interface AudioStreamerOptions {
bufferThreshold?: number; // Buffer threshold in seconds (default: 5)
enableCaching?: boolean; // Enable caching (default: true)
enableTrimming?: boolean; // Enable silence trimming (default: true)
mimeType?: string; // Force specific MIME type
silenceThresholdDb?: number; // Silence threshold in dB (default: -50)
minSilenceMs?: number; // Min silence duration in ms (default: 100)
cacheDbName?: string; // IndexedDB database name
cacheStoreName?: string; // IndexedDB store name
}interface PlaylistOptions {
audioStreamerOptions?: AudioStreamerOptions; // Options for underlying AudioStreamer
}
interface SoundEffectOptions {
enableCaching?: boolean; // Enable persistent caching (default: true)
cacheDbName?: string; // IndexedDB database name (default: 'sound-effects-cache')
cacheStoreName?: string; // IndexedDB store name (default: 'sound-effects')
maxConcurrentSounds?: number; // Max concurrent sounds (default: 8)
defaultVolume?: number; // Default volume 0-1 (default: 1.0)
preloadSounds?: boolean; // Preload on registration (default: false)
audioStreamerOptions?: AudioStreamerOptions; // Advanced streaming options
}
`🎛️ Advanced Usage
$3
`typescript
import { AudioProcessor } from 'audio.libx.js';const processor = new AudioProcessor();
// Process audio chunks with custom options
const result = await processor.processAudio(chunks, {
trimSilence: true,
silenceThresholdDb: -40,
minSilenceMs: 200,
outputFormat: 'wav'
});
// Get processed audio as blob
const audioBlob = result.blob;
`$3
`typescript
import { AudioCache } from 'audio.libx.js';const cache = new AudioCache('my-app-cache', 'audio-store');
await cache.initialize();
// Store audio chunks
await cache.set('audio-id', chunks, 'audio/mpeg');
// Retrieve audio chunks
const chunks = await cache.get('audio-id');
// Cleanup old entries
const deletedCount = await cache.cleanup({
maxAge: 7 24 60 60 1000, // 7 days
maxEntries: 100,
minAccessCount: 2
});
`$3
`typescript
import { MediaSourceHelper } from 'audio.libx.js';const helper = MediaSourceHelper.getInstance();
// Check capabilities
const capabilities = helper.getCapabilities();
console.log('Supported MIME types:', capabilities.supportedMimeTypes);
// Detect audio format
const format = helper.detectAudioFormat(audioData);
console.log('Detected format:', format.type); // 'mp3', 'wav', etc.
// Create MediaSource with cross-platform support
const mediaSourceInfo = helper.createMediaSource();
`🌐 Browser Compatibility
- Chrome/Edge: Full support
- Firefox: Full support
- Safari: Full support (uses ManagedMediaSource on iOS 17.1+)
- Mobile: Optimized for mobile browsers
$3
- MediaSource Extensions support
- IndexedDB support (for caching)
- Web Audio API support (for audio processing)
📱 Mobile Considerations
The library automatically handles mobile-specific optimizations:
- Uses
ManagedMediaSource on iOS 17.1+ for better performance
- Adaptive buffering based on connection speed
- Memory-efficient chunk processing
- Touch interaction handling for audio context initialization🔍 Examples
Check out the
/examples directory for complete working examples:- Comprehensive Demo: Interactive demo with all features including playlist management and sound effects (
demo.html)
- Basic Usage: Simple streaming with default options (basic-usage.html)
- Recording Example: Complete recording workflow (recording-example.html)
- Advanced Configuration: Custom options and event handling
- Cache Management: Working with the cache system
- Audio Processing: Custom audio processing workflows🛠️ Development
`bash
Install dependencies
npm installBuild the library
npm run buildRun tests
npm testWatch mode for development
npm run devFormat code
npm run format
``The library is optimized for performance:
- Memory Usage: Chunked processing keeps memory usage low
- Network Efficiency: Progressive streaming reduces initial load time
- Cache Performance: Smart caching reduces redundant downloads
- Processing Speed: Efficient audio processing with Web Audio API
Contributions are welcome! Please read our contributing guidelines and submit pull requests to our GitHub repository.
MIT License - see the LICENSE file for details.
This library was inspired by reverse-engineering advanced audio streaming mechanisms and aims to provide a production-ready solution for progressive audio streaming in web applications.
---
audio.libx.js - Making audio streaming seamless and efficient for modern web applications.