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

@qgustavor/stream-audio-fingerprint

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@qgustavor/stream-audio-fingerprint

Audio landmark fingerprinting as a JavaScript module

  • 2.0.6
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
4.6K
decreased by-27.97%
Maintainers
1
Weekly downloads
 
Created
Source

Audio landmark fingerprinting as a JavaScript module

This module is module that converts a PCM audio signal into a series of audio fingerprints. It works with audio tracks as well as with unlimited audio streams, e.g. broadcast radio.

It's based on lpolito/stream-audio-fingerprint which is based adblockradio/stream-audio-fingerprint which is one of the foundations of the Adblock Radio project.

Credits and description

Check the original project.

Usage

npm install @qgustavor/stream-audio-fingerprint

The algorithm is in src/codegen_landmark.ts.

A demo usage is proposed below. It requires the executable ffmpeg and Deno to run.

import Codegen from './codegen_landmark.ts'

const decoder = Deno.run({
  cmd: [
    'ffmpeg',
    '-i', 'pipe:0',
    '-acodec', 'pcm_s16le',
    '-ar', '22050',
    '-ac', '1',
    '-f', 's16le',
    '-v', 'fatal',
    'pipe:1'
  ],
  stdout: 'piped',
  stdin: 'inherit'
})

const fingerprinter = new Codegen()
for await (const audioData of decoder.stdout.readable) {
  const data = fingerprinter.process(audioData)
  for (let i = 0; i < data.tcodes.length; i++) {
    console.log(`time=${data.tcodes[i]} fingerprint=${data.hcodes[i]}`)
  }
}

and then we pipe audio data, either a stream or a file

curl http://radiofg.impek.com/fg | deno run --allow-run=ffmpeg codegen_demo.mjs
deno run --allow-run=ffmpeg codegen_demo.mjs < awesome_music.mp3

Type definitions are not included because Deno can load TypeScript files directly and because this TypeScript issue.

License

See LICENSE file.

Keywords

FAQs

Package last updated on 06 Aug 2022

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