Giter Club home page Giter Club logo

audio-track-mixer's Introduction

Audio Track Mixer

English | δΈ­ζ–‡

Mix audio tracks (MediaStreamTrack) into one.

Installation

package manager

Install with npm or yarn

npm:

npm install audio-track-mixer --save

yarn:

yarn add audio-track-mixer

script label

<script src="index.js"></script>

Importing

ES6

import AudioTrackMixer from 'audio-track-mixer';

ES5 with npm

const AudioTrackMixer = require('audio-track-mixer');

script

When use script label, AudioTrackMixer will be a global Object.

Usage

const mixer = new AudioTrackMixer();

mixer.addTrack(trackA);
mixer.addTrack(trackB);

const mixedTrack = mixer.getMixedTrack();

API

See full APIs.

Some Basic Methods of AudioTrackMixer

1. addTrack

Add audio track into the mixer.

examples
mixer.addTrack(trackA);
mixer.addTrack(trackB);

It's a chain function, so you can also use it just like this

mixer.addTrack(trackA).addTrack(trackB);

2. getMixedTrack

Get mixed audio track from the mixer after adding tracks.

examples
const track = mixer.getMixedTrack();

3. removeTrack

Remove audio track if it has been already added into the mixer or will do nothing.

examples
mixer.removeTrack(trackA);
mixer.removeTrack(trackB);

It's a chain function, so you can also use it just like this

mixer.removeTrack(trackA).removeTrack(trackB);

4. destroy

Clear cache of the mixer to destroy it.

examples
const result = mixer.destroy();

audio-track-mixer's People

Contributors

poplark avatar galzk avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.