const bass = require('../old/basswrapper').basswrapper;
const basslib = new bass();
const moment = require('moment');
const appRoot = require('app-root-path');
let song = appRoot.path + '/test.mp3';
const iceCast = require('../clsIceCast2').clsIceCast;
const ice = new iceCast();

console.log(song);

basslib.BASS_Init(-1, 44100, basslib.BASS_DEVICE_STEREO);
let mixer = basslib.BASS_Mixer_StreamCreate(44100, 2, basslib.BASS_SAMPLE_FLOAT);
let chan = basslib.BASS_StreamCreateFile(0, song, 0, 0, basslib.BASS_STREAM_DECODE | basslib.BASS_SAMPLE_FLOAT);
let add = basslib.BASS_Mixer_StreamAddChannel(mixer, chan, basslib.BASS_SAMPLE_FLOAT);
basslib.BASS_ChannelPlay(mixer, 1);

ice.createIceCastMixer(44100, 2);
ice.IceCastStream(ice.IceCastMixer);

setInterval(()=> {
    console.log(basslib.BASS_GetCPU());
    console.log(basslib.BASS_ChannelGetPosition(chan, 0));
    console.log(basslib.BASS_ChannelGetLength(chan, 0));
},1000);