-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstream2icecast.js
37 lines (31 loc) · 916 Bytes
/
stream2icecast.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
registerPlugin({
name: 'stream2icecast',
version: '1.0',
description: '',
author: 'Michael Friese <[email protected]>',
vars: [{
name: 'streamServer',
title: 'StreamServer URL',
type: 'string',
placeholder: 'http://sv.meme.com:8000/autodj'
}, {
name: 'streamUser',
title: 'User',
type: 'string'
}, {
name: 'streamPassword',
title: 'Password',
type: 'string'
}]
}, function (sinusbot, config) {
var engine = require('engine'), audio = require('audio');
if(!config.streamUser){
config.streamUser = 'source';
}
if (config.streamServer && config.streamPassword){
audio.setAudioReturnChannel(2);
audio.streamToServer(config.streamServer, config.streamUser, config.streamPassword);
}else{
engine.log("URL or Password missing!");
}
});