Socket
Book a DemoInstallSign in
Socket

is-opus

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-opus

Check if a Buffer/Uint8Array is an OPUS audio file

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
2
Created
Source

is-opus

NPM version Build Status

Check if a Buffer/Uint8Array is an OPUS audio file.

Install

$ npm install --save is-opus

Usage

Node.js
var readChunk = require('read-chunk'); // npm install read-chunk
var isOpus = require('is-opus');
var buffer = readChunk.sync('unicorn.opus', 0, 36);

isOpus(buffer);
//=> true
Browser
var xhr = new XMLHttpRequest();
xhr.open('GET', 'unicorn.opus');
xhr.responseType = 'arraybuffer';

xhr.onload = function () {
	isOpus(new Uint8Array(this.response));
	//=> true
};

xhr.send();

API

isOpus(buffer)

Accepts a Buffer (Node.js) or Uint8Array.

It only needs the first 36 bytes.

License

MIT © t1st3

Keywords

opus

FAQs

Package last updated on 11 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts