New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@pomle/audio-ident

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pomle/audio-ident

Ultrafast zero-dependency JavaScript library for identifying WAVE and FLAC files in the browser.

  • 1.0.6
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

audio-ident

Ultrafast zero-dependency JavaScript library for identifying WAVE and FLAC files in the browser.

Useful when you expect a user to upload big WAVE or FLAC files and want to ensure they comply with a specific format before the user have started sending data to your server.

Usage

  1. Install
npm install @pomle/audio-ident
  1. Import
import { identifyFile } from "@pomle/audio-ident";
  1. Call identifyFile with a File object from a DragEvent for example.
const handleDrop = async event => {
  event.preventDefault();
  const files = event.dataTransfer.files;
  for (const file of files) {
    const fileInfo = await identifyFile(file);
    console.log(fileInfo);
  }
}

fileInfo will contain an object like the following.

{
  type: "WAVE", 
  format: 1, /* A WAVE file may use compression. Format contains 1 if PCM (Uncompressed). */
  sampleRate: 44100, 
  channels: 2, 
  bitDepth: 16
}

Examples

Vanilla JS

FAQs

Package last updated on 05 Jul 2020

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

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