Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

oscilloscope

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oscilloscope - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

dist/oscilloscope.min.js

2

dist/oscilloscope.js

@@ -1,2 +0,2 @@

module.exports=function(){function t(t,i){if(void 0===i&&(i={}),!(t instanceof window.AudioNode))throw new Error("Oscilloscope source must be an AudioNode");t instanceof window.AnalyserNode?this.analyser=t:(this.analyser=t.context.createAnalyser(),t.connect(this.analyser)),i.fftSize&&(this.analyser.fftSize=i.fftSize),this.timeDomain=new Uint8Array(this.analyser.frequencyBinCount),this.drawRequest=0}var i=t.prototype;return i.animate=function(t,i,e,n,a){var s=this;if(this.drawRequest)throw new Error("Oscilloscope animation is already running");this.ctx=t,function o(){t.clearRect(0,0,t.canvas.width,t.canvas.height),s.draw(t,i,e,n,a),s.drawRequest=window.requestAnimationFrame(o)}()},i.stop=function(){this.drawRequest&&(window.cancelAnimationFrame(this.drawRequest),this.drawRequest=0,this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height))},i.draw=function(t,i,e,n,a){void 0===i&&(i=0),void 0===e&&(e=0),void 0===n&&(n=t.canvas.width-i),void 0===a&&(a=t.canvas.height-e),this.analyser.getByteTimeDomainData(this.timeDomain);var s=n/this.timeDomain.length;t.beginPath();for(var o=0;o<this.timeDomain.length;o+=2)t.lineTo(i+o*s,e+a*(this.timeDomain[o]/256));t.stroke()},t}();
module.exports=function(){function t(t,i){if(void 0===i&&(i={}),!(t instanceof window.AudioNode))throw new Error("Oscilloscope source must be an AudioNode");t instanceof window.AnalyserNode?this.analyser=t:(this.analyser=t.context.createAnalyser(),t.connect(this.analyser)),i.fftSize&&(this.analyser.fftSize=i.fftSize),this.timeDomain=new Uint8Array(this.analyser.fftSize),this.drawRequest=0}var i=t.prototype;return i.animate=function(t,i,e,a,n){var s=this;if(this.drawRequest)throw new Error("Oscilloscope animation is already running");this.ctx=t,function o(){t.clearRect(0,0,t.canvas.width,t.canvas.height),s.draw(t,i,e,a,n),s.drawRequest=window.requestAnimationFrame(o)}()},i.stop=function(){this.drawRequest&&(window.cancelAnimationFrame(this.drawRequest),this.drawRequest=0,this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height))},i.draw=function(t,i,e,a,n){void 0===i&&(i=0),void 0===e&&(e=0),void 0===a&&(a=t.canvas.width-i),void 0===n&&(n=t.canvas.height-e),this.analyser.getByteTimeDomainData(this.timeDomain);var s=a/this.timeDomain.length;t.beginPath();for(var o=0;o<this.timeDomain.length;o+=2)t.lineTo(i+o*s,e+n*(this.timeDomain[o]/256));t.stroke()},t}();
//# sourceMappingURL=oscilloscope.js.map
{
"name": "oscilloscope",
"version": "1.2.0",
"version": "1.3.0",
"description": "Waveform audio visualizer for the HTML5 canvas",
"source": "src/index.js",
"main": "dist/oscilloscope.js",
"module": "dist/oscilloscope.module.js",
"unpkg": "dist/oscilloscope.umd.js",
"module": "src/index.js",
"dependencies": {},
"devDependencies": {
"microbundle": "^0.12.0",
"microbundle": "^0.12.4",
"rimraf": "^3.0.2",
"standard": "*"
"standard": "^16.0.2",
"webpack": "^5.4.0",
"webpack-cli": "^4.2.0"
},

@@ -18,4 +19,5 @@ "scripts": {

"clean": "rimraf dist/*",
"build": "npm run clean && microbundle --name Oscilloscope",
"prepare": "npm run build"
"build": "microbundle --format=cjs",
"bundle": "webpack --entry=./dist/oscilloscope.js --devtool=source-map --output-library=Oscilloscope --output-filename=oscilloscope.min.js",
"prepare": "npm run clean && npm run build && npm run bundle"
},

@@ -22,0 +24,0 @@ "repository": {

@@ -19,3 +19,3 @@ # oscilloscope

```html
<script src="//unpkg.com/oscilloscope@1.1.0/dist/oscilloscope.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/oscilloscope@1.x/dist/oscilloscope.min.js"></script>
```

@@ -22,0 +22,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc