Author Topic: Encoder does NOT exist! On bolded line  (Read 311 times)

renta75

  • Posts: 1
Encoder does NOT exist! On bolded line
« on: 6 Jun '23 - 13:47 »
int mixer = BassMix.BASS_Mixer_StreamCreate(48000, 2, BASSFlag.BASS_DEFAULT);


        int stream = Bass.BASS_StreamCreateFile("c:\\music\\preview.mp3", 0, 0, BASSFlag.BASS_STREAM_DECODE);
        int stream2 = Bass.BASS_StreamCreateFile("c:\\music\\golden.mp3", 0, 0, BASSFlag.BASS_STREAM_DECODE);

        BassMix.BASS_Mixer_StreamAddChannel(mixer, stream, BASSFlag.BASS_STREAM_DECODE);
        BassMix.BASS_Mixer_StreamAddChannel(mixer, stream2, BASSFlag.BASS_STREAM_DECODE);
       

        EncoderOGG lame = new EncoderOGG(mixer);
        lame.InputFile = null;
        lame.OutputFile = null;
        lame.OGG_Bitrate = (int)BaseEncoder.BITRATE.kbps_320;
        lame.OGG_Quality = 10;


        ICEcast icEcast = new ICEcast(lame);
        icEcast.ServerAddress = "35.180.68.3";
        icEcast.ServerPort = 8000;
        icEcast.Username = "source";
        icEcast.Password = "hackme";
        icEcast.MountPoint = $"/{userName}.ogg";
        icEcast.StreamName = "StreamName";
        icEcast.StreamGenre = "Test Genre";
        icEcast.PublicFlag = false;
        icEcast.SongTitle = "Test Song";


        BroadCast cBroadCast = new BroadCast(icEcast);
        cBroadCast.AutoReconnect = true;
        cBroadCast.ReconnectTimeout = 5;

        // mute it (if you don't want to 'hear' it)
        Bass.BASS_ChannelSetAttribute(mixer, BASSAttribute.BASS_ATTRIB_VOL, 0f);
        // play it (which feeds the encoder/broadcaster)
        Bass.BASS_ChannelPlay(mixer, false);
        var bConnect = cBroadCast.AutoConnect();