soundamplitude

1.5.1 • Public • Published

Sound Amplitude

Demo

https://youtu.be/8SMhPq5m8fQ

cool

Installation

npm install soundamplitude

**ES6 **

import Soundamplitude from "./node_module/soundamplitude/soundamplitude.js"

Initalize object

var options = {}
options.fps = 50 // control how frequent the callback return


var url = "https://www.xxx.com/xxx.mp3"

var soundamplitude = new Soundamplitude(url,options)

play / stop (please make sure you must start play by a click event)

soundamplitude.play()

Call back to get amplitude

soundamplitude.on("amplitude",e=>{

console.log(e.amplitude) })

Callback when ended

soundamplitude.on("ended",()=>{

})

change volume

0< volume <1

soundamplitude.changevolume(volume)

Release

soundamplitude.release()

Package Sidebar

Install

npm i soundamplitude

Weekly Downloads

1

Version

1.5.1

License

ISC

Unpacked Size

113 kB

Total Files

7

Last publish

Collaborators

  • chings228