Author Topic: Can we have more than one instance of Icecast2 in our app? SHOUTcast seems to...  (Read 125 times)

afsanchez001

  • Posts: 98
Hi,

Am I only allowed on instantiation, i.e. (just one instance) of Icecast2 in my app? 

I have three instances of SHOUTcast running fine, and the (first) of three Icecast2 instances running fine.

However, my second and third instance of Icecast2 NEVER activate.  They always return as NULL every time I try to start them.  As if the public static ICEcast MyIcecast; code fails for anything after my first instance of Icecast2.

Here are the global variables for all my instances. (3 SHOUTcast, 3 Icecast2).

Code: [Select]
            public static SHOUTcast MyShoutcast1; // instance 1
            public static SHOUTcast MyShoutcast2; // instance 2
            public static SHOUTcast MyShoutcast3; // instance 3

            public static ICEcast MyIcecast1; // instance 1
            public static ICEcast MyIcecast2; // instance 2    <--- Never comes to life, always returns as NULL
            public static ICEcast MyIcecast2; // instance 3    <--- Never comes to life, always returns as NULL

I start them with all the paramaters filled in as directed, and then this is my code to instantiate:

I use these and they are interchangeable for both SHOUTcast and Icecast2.
Code: [Select]
            // Un4seen.Bass.Misc.BroadCast...

            public static BroadCast BroadCast1; // stream 1
            public static BroadCast BroadCast2; // stream 2
            public static BroadCast BroadCast3; // stream 3

            // And when I need the stream I just call:
            BroadCast1 = new BroadCast(Util.GlobalVars.MyShoutcast1);  // for SHOUTcast

            // or I call...
            BroadCast1 = new BroadCast(Util.GlobalVars.MyIcecast1);  // for Icecast2

Am I missing something fundamental here?  Are we allowed multiple SHOUTcast streams, but only one Icecast2 stream?

Thanks!  :)

afsanchez001

  • Posts: 98
SOLVED IT...

Guys, elswhere in my code for the other two Icecast2 instances I forgot to instantiate the LameEncoder for streams 2 and 3.

Added this, works now:
Code: [Select]
          MyIcecast = new ICEcast(LameEncoder, true);

Thanks everyone! :)