3.9.1 • Published 13 days ago

xsound v3.9.1

Weekly downloads
94
License
MIT
Repository
github
Last release
13 days ago

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

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 git@github.com:Korilakkuma/XSound.git
$ cd XSound
$ npm install
$ npm run dev
$ open http://localhost:8080/playground/

Use Docker

$ git clone git@github.com: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).

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

3.9.1

13 days ago

3.9.0

26 days ago

3.8.3

1 month ago

3.8.2

2 months ago

3.8.1

3 months ago

3.8.0

4 months ago

3.7.0

4 months ago

3.6.1

4 months ago

3.6.0

5 months ago

3.5.2

5 months ago

3.5.1

6 months ago

3.5.0

7 months ago

3.2.2

11 months ago

3.2.1

12 months ago

3.4.0

10 months ago

3.4.4

8 months ago

3.4.3

8 months ago

3.4.2

8 months ago

3.4.1

9 months ago

3.3.1

10 months ago

3.3.0

10 months ago

3.2.0

12 months ago

3.0.16

1 year ago

3.0.17

1 year ago

3.1.1

1 year ago

3.1.0

1 year ago

3.0.13

2 years ago

3.0.14

1 year ago

3.0.15

1 year ago

3.0.12

2 years ago

3.0.10

2 years ago

3.0.11

2 years ago

3.0.8

2 years ago

3.0.7

2 years ago

3.0.9

2 years ago

3.0.4

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.6

2 years ago

3.0.5

2 years ago

3.0.0

2 years ago

3.0.0-rc

2 years ago

3.0.0-beta

2 years ago

3.0.0-alpha

2 years ago

2.27.1

3 years ago

2.27.0

3 years ago

2.28.1

2 years ago

2.28.0

2 years ago

2.26.5

3 years ago

2.26.4

3 years ago

2.26.3

3 years ago

2.26.2

3 years ago

2.26.1

3 years ago

2.26.0

3 years ago

2.25.1

3 years ago

2.24.2

3 years ago

2.25.2

3 years ago

2.25.0

3 years ago

2.24.7

3 years ago

2.24.6

3 years ago

2.24.5

3 years ago

2.24.4

3 years ago

2.24.3

3 years ago

2.24.1

3 years ago

2.24.0

3 years ago

2.23.0

3 years ago

2.22.0

3 years ago

2.21.1

3 years ago

2.21.0

3 years ago

2.20.1

3 years ago

2.20.0

4 years ago

2.19.11

4 years ago

2.19.10

4 years ago

2.19.9

4 years ago

2.19.8

4 years ago

2.19.7

4 years ago

2.19.6

4 years ago

2.19.5

4 years ago

2.19.4

4 years ago

2.19.3

4 years ago

2.19.2

4 years ago

2.19.1

4 years ago

2.19.0

4 years ago

2.18.1

4 years ago

2.18.0

4 years ago

2.17.0

4 years ago

2.16.1

5 years ago

2.16.0

5 years ago

2.15.2

5 years ago

2.15.1

5 years ago

2.15.0

5 years ago

2.14.4

5 years ago

2.14.3

5 years ago

2.14.2

5 years ago

2.14.1

5 years ago

2.14.0

5 years ago

2.13.3

5 years ago

2.13.2

5 years ago

2.13.1

5 years ago

2.13.0

5 years ago

2.12.0

5 years ago

2.11.1

5 years ago

2.11.0

5 years ago

2.10.5

5 years ago

2.10.4

5 years ago

2.10.3

5 years ago

2.10.2

5 years ago

2.10.1

5 years ago

2.10.0

5 years ago

2.9.2

5 years ago

2.9.1

5 years ago

2.9.0

5 years ago

2.8.3

5 years ago

2.8.2

5 years ago

2.8.1

5 years ago

2.8.0

5 years ago

2.7.7

5 years ago

2.7.6

5 years ago

2.7.5

5 years ago

2.7.4

5 years ago

2.7.3

5 years ago

2.7.2

5 years ago

2.7.1

5 years ago

2.7.0

6 years ago

2.6.2

6 years ago

2.6.1

6 years ago

2.6.0

6 years ago

2.5.0

6 years ago

2.4.3

6 years ago

2.4.2

6 years ago

2.4.1

6 years ago

2.4.0

6 years ago

2.3.4

6 years ago

2.3.3

6 years ago

2.3.2

6 years ago

2.3.1

6 years ago

2.3.0

6 years ago

2.2.3

6 years ago

2.2.2

6 years ago

2.2.1

6 years ago

2.2.0

6 years ago

2.1.0

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.13.5

7 years ago

1.13.4

7 years ago

1.13.2

7 years ago

1.13.1

7 years ago

1.13.0

7 years ago

1.12.1

7 years ago

1.12.0

9 years ago

1.11.0

9 years ago

1.10.0

9 years ago