Giter Club home page Giter Club logo

tarang's Introduction

Tarang

audio frequency visualization using d3 graph for react

NPM JavaScript Style Guide

Example

example here

alternate link

Install

npm install --save tarang

Whats New?

The version 1.1.0 starts development in direction of support for playlist. If you want to use Tarang for simply visualization of single audio track, you may want to use previous stable version 1.0.8.

  1. loop : to loop current audio
  2. onEnded : event that is fired after the audio has ended
  3. pause button: when controls are visible, play and pause button can be toggled in between

Usage

Bar visualization

import React, { Component } from 'react'

import Tarang from 'tarang'
import 'tarang/dist/index.css'

class Example extends Component {
  render() {
    return <Tarang.Bar
        loop={true}
        width={500}
        height={200}
        scale={1}
        controls={true}
        muted={false}
        volume={0.8}
        audioUrl={"url-of-mp3-file"}
        coverArtUrl={"url-of-cover-art-image-file"}
      />
  }
}

Line visualization

import React, { Component } from 'react'

import Tarang from 'tarang'
import 'tarang/dist/index.css'

class Example extends Component {
  render() {
    return <Tarang.Line
        onEnded={() => alert("song ended")}
        width={500}
        height={200}
        scale={1}
        controls={true}
        muted={false}
        volume={0.8}
        audioUrl={"url-of-mp3-file"}
        coverArtUrl={"url-of-cover-art-image-file"}
      />
  }
}

Note:

  1. make sure that the width is of power of two (e.g., 2, 4, 8, etc)
  2. loop and onEnded if used together, can be used to change the track after current track has ended.

License

MIT © kamalyesh

tarang's People

Contributors

kamalyesh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

sudarshan55

tarang's Issues

Tarang has missing dependency issue on Node < 17

Tarang has missing dependencies for node version less than 17.

After installing tarang I got this

./node_modules/tarang/dist/index.modern.js
Module not found: Can't resolve 'd3' in 'D:\project1\node_modules\tarang\dist'

My node version is : 14.0.2

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.