[jitsi-dev] LibJitsi Audio Conference


#1

Dear Jitsi Development Team

As a part of an education project, I have to code an audio conference software. For the handling of the audio streams, I want to use libjitsi. I got your example and it's running fine for two users.

Now, if I want to use libjitsi in my project, I have to connect more than two peers, at least 8.

Can I reach this goal with libjitsi?

Is it necessary to define a master peer with different code?

Do you have any examples according to manage multiple clients in a conference?

Actually I'm creating a mixer for the audio device and loop through the peers to create a stream for each client with the same media device.

Here's my code:

     MediaService service = LibJitsi.getMediaService();
             MediaDevice audioDevice = service.createMixer(service
                     .getDefaultDevice(MediaType.AUDIO, MediaUseCase.CALL));
             StreamConnector connector = new DefaultStreamConnector(
                     new DatagramSocket(config.getLocalPort()),
                     new DatagramSocket(config.getLocalPort() + 1));

             for (Target target:config.getTargets()) { //IP and Port of targets is known, Make a stream for each target
                 MediaStream stream = service.createMediaStream(connector, audioDevice);
                 stream.setTarget(new MediaStreamTarget(target.getDataSocket(),
target.getControlSocket()));
stream.setDirection(MediaDirection.SENDRECV);
                 streams[i] = stream;
             }

             for (MediaStream stream:streams) {
                 stream.start();
             }

Thank you for your answer.

Yours sincerely,

Lorenz B�sch


#2

Hey Lorenz,

Dear Jitsi Development Team

As a part of an education project, I have to code an audio conference
software. For the handling of the audio streams, I want to use libjitsi.
I got your example and it’s running fine for two users.

Now, if I want to use libjitsi in my project, I have to connect more
than two peers, at least 8.

Can I reach this goal with libjitsi?

Sure. You can already do this with Jitsi (and hence libjitsi).

Of course your computer would actually need to be able to mix the
participants.

Is it necessary to define a master peer with different code?

Libjitsi just handles the mixing. It does so on the local machine. It is
up to you to choose which of the 8 libjitsi instances participating in
the call would become the mixer.

Do you have any examples according to manage multiple clients in a
conference?

I am afraid there are no standalone examples. However, both the SIP and
XMPP protocol providers in Jitsi support conferences so you may look
there for inspiration. Then, if you are willing to create an example
that we could add on jitsi.org, we'd be happy to have it.

Hope this helps,
Emil

···

On 23.11.12, 15:49, Lorenz Bösch wrote:

Actually I’m creating a mixer for the audio device and loop through the
peers to create a stream for each client with the same media device.

Here’s my code:

            MediaService service = LibJitsi.getMediaService();
            MediaDevice audioDevice = service.createMixer(service
                    .getDefaultDevice(MediaType.AUDIO, MediaUseCase.CALL));
            StreamConnector connector = new DefaultStreamConnector(
                    new DatagramSocket(config.getLocalPort()),
                    new DatagramSocket(config.getLocalPort() + 1));

            for (Target target:config.getTargets()) { //IP and Port
of targets is known, Make a stream for each target
                MediaStream stream =
service.createMediaStream(connector, audioDevice);
                stream.setTarget(new
MediaStreamTarget(target.getDataSocket(),
                                                                        
                                target.getControlSocket()));
                stream.setDirection(MediaDirection.SENDRECV);
                streams[i] = stream;
            }
           
            for (MediaStream stream:streams) {
                stream.start();
            }

Thank you for your answer.

Yours sincerely,

Lorenz Bösch

--
https://jitsi.org