icecast-song-recognition

Identify songs from Icecast streams via ACRCloud song recognition.

Usage no npm install needed!

<script type="module">
  import icecastSongRecognition from 'https://cdn.skypack.dev/icecast-song-recognition';
</script>

README

icecast-song-recognition

An npm module for getting song metadata from Icecast streams with sound recognition.

Perfect for Icecast streams that don't already contain song metadata.

GitHub issues Travis CI Build

Installation

npm i icecast-song-recognition --save

Usage

const { identifySong } = require("icecast-song-recognition");


const acrConfig = {
  host: '*****.acrcloud.com',
  access_key: '*****',
  access_secret: '*****'
};


identifySong({
  acrConfig,
  streamURL: 'http://stream2.datacenter.by:8002/energy'
})
.catch(err => { console.log(new Error(err)) })
.then(metadata => console.log(metadata));

API

Name Default Type Description
acrConfig null Object API key from ACRCloud
streamURL null String Direct URL to Icecast audio
recordingDuration 3000 Number Time (in ms) to record Icecast stream before recognizing music
tempPath "./temp" String Path to store temporary audio files