Git Product home page Git Product logo

webaudiotrack's Introduction

Web Audio Track

This is an easy to use plugin that enables you to record and play back a single track of audio. You can also load audio from a url and concatenate audio from recorded sounds and external audio files into a single audio track.

Click here for the demo

An audio track can be created like so:

var audioTrack = new WebAudioTrack()

This creates a single track of audio. For more than one track, or source simply construct multiple instances e.g.

var microphoneTrack = new WebAudioTrack();
var mp3Track = new WebAudioTrack();

You can then use the methods below to record and playback audio.

Properties

isPlaying

Type: Boolean

isRecording

Type: Boolean

volume

Type: Number

Methods

play():Promise

Play the audio track.

stop()

Stop playing the audio track.

startRecording(callback?:function)

Start recording via the microphone. Takes an optional callback parameter.

If called a second time the previous recording will be overwritten.

stopRecording(callback?:function)

Stop the recording process. Takes an optional callback parameter.

getRecordingTime(): number

Returns the length of the recording in seconds

setVolume(value: number)

Set the playback volume. Value should be in between 0 and 1.

loadUrl(url: string): Promise

Loads audio data from an external file specified in the url parameter.

appendAudioFromTrack(WebAudioTrack)

Append audio from another WebAudiotrack instance to the current audio track.

appendAudioFromUrl(url)

Append audio from an external file to the current audio track.

webaudiotrack's People

Contributors

danielstorey avatar elbywan avatar

Watchers

 avatar  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.