Skip to content

Enterprise

Kain edited this page Apr 19, 2021 · 6 revisions

Warning:

This will use 1 request per 18 seconds of audio. When you upload a file, The AudD servers think of it as a bunch of 18 seconds long audio chunks. If you don't want every one of these chunks to be recognized and counted as the requests, there are two parameters that you can use: skip and every.

  • skip - how many 18 seconds long audio chunks are skipped after the ones that are recognized.
  • every - how many chunks should be recognized in a row.

So if you want to recognize 18 seconds, then skip 54 seconds, then recognize 18 seconds again, skip 54 seconds again, etc., these parameters should be skip=3 and every=1. If you want to skip 108 seconds instead so it counts as 1 request per 126 seconds of audio, send skip=6 and every=1.

This means if you upload a 2 minute audio file without using skip or every, you will use 7 of your requests.

Usage:

See audd.io documentation for the enterprise endpoint

audd.enterprise.fromFile('test.mp3', { skip: 3, every: 1 }).then((res) => {
    res.result.forEach((result) => {
        result.songs.forEach((song) => console.log(`${song.title} by ${song.artist}`));
    });
});

Example Response

{
    "status": "success",
    "result": [
        {
            "songs": [
                {
                    "artist": "Imagine Dragons",
                    "title": "Warriors",
                    "album": "Warriors",
                    "release_date": "2014-09-18",
                    "label": "Universal Music",
                    "timecode": "00:40",
                    "song_link": "https://lis.tn/Warriors"
                },
                {
                    "artist": "Alan Walker",
                    "title": "Faded",
                    "album": "Faded",
                    "release_date": "2016-02-12",
                    "timecode": "02:59",
                    "song_link": "https://youtu.be/60ItHLz5WEA"
                }
            ],
            "offset": "00:00"
        }
    ],
    "execution_time": "451.276339ms"
}
Clone this wiki locally