npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

xsound

v3.9.1

Published

XSound gives Web Developers Powerful Audio Features Easily !

Downloads

1,240

Readme

XSound - Powerful Audio Features Easily ! -

Node.js CI node-current License: MIT npm jsDelivr

Overview

XSound gives Web Developers Powerful Audio Features Easily !
In concrete, XSound is useful to implement the following features.

  • Create Sound
  • Play the One-Shot Audio
  • Play the Audio
  • Play the Media
  • Streaming (by WebRTC)
  • MIDI (by Web MIDI API)
  • MML (Music Macro Language)
  • Effectors (Compressor / Wah / Equalizer / Tremolo / Phaser / Chorus / Delay / Reverb ... etc)
  • Visualization (Overview in Time Domain / Time Domain / Spectrum)
  • Multi-Track Recording (Create WAVE file)
  • Audio Streaming
  • Visual Audio Sprite

XSound don't depend on other libraries or frameworks (For example, jQuery, React).

Supported Browsers

Getting Started

In case of using as full stack (For example, use oscillator) ...

X('oscillator').setup([true, true, false, false]).ready(2, 5).start([440, 880]).stop();

or, in case of using as module base (For example, use chorus effector) ...

// The instance of `AudioContext`
const context = X.get();

// Create the instance of `Chorus` that is defined by XSound
const chorus = new X.Chorus(context);

const oscillator = context.createOscillator();

// The instance that is defined by XSound has connectors for input and output
oscillator.connect(chorus.INPUT);
chorus.OUTPUT.connect(context.destination);

// Set parameters for chorus
chorus.param({
  time : 0.025,
  depth: 0.5,
  rate : 2.5,
  mix  : 0.5
});

// Activate
chorus.activate();

oscillator.start(0);

XSound enable to using the following classes (Refer to API Documentation for details).

X.Analyser(context: AudioContext);
X.Recorder(context: AudioContext);

// Effectors
X.Autopanner(context: AudioContext);
X.BitCrusher(context: AudioContext);
X.Chorus(context: AudioContext);
X.Compressor(context: AudioContext);
X.Delay(context: AudioContext);
X.Equalizer(context: AudioContext);
X.Filter(context: AudioContext);
X.Flanger(context: AudioContext);
X.Fuzz(context: AudioContext);
X.Listener(context: AudioContext);
X.NoiseGate(context: AudioContext);
X.NoiseSuppressor(context: AudioContext);
X.OverDrive(context: AudioContext);
X.Panner(context: AudioContext);
X.Phaser(context: AudioContext);
X.PitchShifter(context: AudioContext);
X.Preamp(context: AudioContext);
X.Reverb(context: AudioContext);
X.Ringmodulator(context: AudioContext);
X.Stereo(context: AudioContext);
X.Tremolo(context: AudioContext);
X.VocalCanceler(context: AudioContext);
X.Wah(context: AudioContext);

Demo

XSound.app uses this library.

Now, I'm creating website for Web Audio API. Please refer to the following site for understanding API Documentation.

WEB SOUNDER

Installation

$ npm install --save xsound

or,

$ yarn add xsound

Usage

In case of using ES Modules,

import { XSound, X } from 'xsound';

If SSR (Server-Side Rendering), use dynamic imports,

async () => {
  const { XSound, X } = await import('xsound');
};

In case of using CDN,

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/xsound@latest/build/xsound.min.js"></script>

Setup

Use Webpack Dev Server

$ git clone [email protected]:Korilakkuma/XSound.git
$ cd XSound
$ npm install
$ npm run dev
$ open http://localhost:8080/playground/

Use Docker

$ git clone [email protected]:Korilakkuma/XSound.git
$ cd XSound
$ npm install
$ npm run watch
$ docker compose up -d --build
$ open http://localhost:8080/playground/

API Documentation

XSound API Documentation

Playground

XSound Playground (Watch by YouTube).

Migration to v3

Please refer to API Documentation for details.

Case sensitive

// Bad (v2 or earlier)
X('audio').module('panner').param({ coneinnerangle: 240 });

// Good (v3)
X('audio').module('panner').param({ coneInnerAngle: 240 });

Use plain object if parameters setter

// Bad (v2 or earlier)
X('oscillator').get(0).param('type', 'sawtooth');

// Good (v3)
X('oscillator').get(0).param({ type: 'sawtooth' });

Validate parameters on the application side

if ((type === 'sine') || (type === 'square') || (type === 'sawtooth') || (type === 'triangle')) {
  X('oscillator').get(0).param({ type });
}

Migration to v3.1.x or later

If use bundle tool and compress class names such as webpack and terser-webpack-plugin,
must add the following options (because of using inline AudioWorkletProcessor).

new TerserWebpackPlugin({
  // ... other options
  terserOptions: {
    keep_classnames: /^.*?Processor$/
  }
})

Pickups

License

Released under the MIT license