Author Topic: continuous encode without any stream.  (Read 219 times)

serkanp

  • Posts: 85
continuous encode without any stream.
« on: 2 Jul '18 - 21:46 »
is it possible to let encoder serve to icecast/shoutcast server if there is no decode data?
currently if there is no data to decode even on mixer channel, the encoder stops sending data.
what i thought was, there is a mixer channel,and mixer channel started playing , and if there is no data, the encoder must still work and there will be no sound on output.

Code: [Select]
let initresult=basslib.BASS_Init(-1,44100,basslib.BASS_DEVICE_SPEAKERS)
let mixer=basslib.BASS_Mixer_StreamCreate(44100,2,basslib.BASS_STREAM_DECODE )
let ee=basslib.BASS_ChannelPlay(mixer,0);


var enc_chan=basslib.BASS_Encode_Start(mixer,'lame -r -m s -s 22050 -b 56 -',basslib.BASS_ENCODE_NOHEAD);
var result=basslib.BASS_Encode_CastInit(enc_chan,
    'http://my-server.com:8000/serkantest',
    '1q2w3e',
    basslib.BASS_ENCODE_TYPE_MP3,
    'test stream',
    'http://your-server-ip',
    'pop',
    'this is my new icecast test',
    'header1\r\nheader2\r\n',
    44100,
    true //public
);

var result=basslib.BASS_Encode_SetNotify(enc_chan,function(handle,status,user) {
    console.log(status)

});

Bello

  • Posts: 40
Re: continuous encode without any stream.
« Reply #1 on: 3 Jul '18 - 08:35 »
Add basslib.BASS_MIXER_NONSTOP to the flags int the BASS_Mixer_StreamCreate call.

serkanp

  • Posts: 85
Re: continuous encode without any stream.
« Reply #2 on: 4 Jul '18 - 09:08 »
Add basslib.BASS_MIXER_NONSTOP to the flags int the BASS_Mixer_StreamCreate call.

thanks! :) it works..