forked from adblockradio/adblockradio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.js
39 lines (31 loc) · 949 Bytes
/
demo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
// Copyright (c) 2018 Alexandre Storelli
const { log } = require("abr-log")("demo");
const { Analyser } = require("./post-processing.js");
const country = "Finland";
const name = "Basso Radio";
log.info("start analyser!");
const abr = new Analyser({
country: country,
name: name,
config: {
predInterval: 1,
saveDuration: 10,
enablePredictorHotlist: true,
enablePredictorMl: true,
saveAudio: true,
saveMetadata: true,
fetchMetadata: true,
verbose: true,
}
});
abr.on("data", function(obj) {
obj.liveResult.audio = "[redacted]";
//log.info("status=" + JSON.stringify(Object.assign(obj, { audio: undefined }), null, "\t"));
});
abr.on("end", function() {
log.info("analyser ended");
});
//setTimeout(abr.stopDl, 15000);