🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

audio-meta

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

audio-meta

Get metadata of audio files from disk or URLS

0.0.1
latest
npm
Version published
Weekly downloads
21
75%
Maintainers
1
Weekly downloads
 
Created
Source

Audio-Meta

Get the metadata of audio files on disk or even as URLS.

For URLS, this module fetches the minimum number of bytes enough to get metadata of the audio and thus remains super fast!

// init
const audioMeta = require('audio-meta');

// get meta
const url =
    'https://cdn.pixabay.com/download/audio/2023/04/17/audio_ae4d57086a.mp3?filename=futuristic-beat-146661.mp3';

audioMeta
    .meta(url)
    .then((resp) => {
        console.log(resp);
    })
    .catch(console.error);

This will output the following info:


{
  request: {
    url: 'https://cdn.pixabay.com/download/audio/2023/04/17/audio_ae4d57086a.mp3?filename=futuristic-beat-146661.mp3',
    headers: {
      date: 2023-04-18T13:05:10.000Z,
      contentType: 'audio/mpeg',
      contentLength: 3883676,
      connection: 'close',
      cfRay: '7b9d1e277c029d03-JNB',
      accessControlAllowOrigin: '*',
      age: 23541,
      cacheControl: +086399-12-31T21:00:00.000Z,
      contentDisposition: 'attachment; filename="futuristic-beat-146661.mp3"',
      etag: '290523affa1536d5bd57f2cd48ab1c8c',
      lastModified: 2023-04-17T09:18:15.000Z,
      cfCacheStatus: 'HIT',
      accessControlAllowMethods: 'GET, HEAD',
      accessControlMaxAge: 86400,
      xAmzReplicationStatus: 'COMPLETED',
      xAmzServerSideEncryption: 'AES256',
      setCookie: [Array],
      vary: 'Accept-Encoding',
      server: 'cloudflare',
      altSvc: 'h3=":443"; ma=86400, h3-29=":443"; ma=86400'
    }
  },
  file: 'https://cdn.pixabay.com/download/audio/2023/04/17/audio_ae4d57086a.mp3?filename=futuristic-beat-146661.mp3',
  size: 3883676,
  tagTypes: [],
  trackInfo: [],
  lossless: false,
  container: 'MPEG',
  codec: 'MPEG 1 Layer 3',
  sampleRate: 44100,
  numberOfChannels: 2,
  bitrate: 256000,
  duration: { durationSecs: 121.364875, pretty: '00:02:01' }
}


Keywords

audio

FAQs

Package last updated on 18 Apr 2023

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