Control remote track volume

Hi,

I’m currently developing with the lib-jitsi-meet API and have a use case where I need to control the track volume from remote participants indivually. Is this possible with the API?

1 Like

I was exactly looking for the same use case as I want lower and raise the volume of participants selectively.

What is your use case?
Me and a friend are looking to build a virtual space and want to simulate the different volume of a “room”

Haha that’s funny, cause that’s exactly the same use case I want to solve!

Have you been able to come closer to a solution?

No but it’s me and a friend trying to put the pieces together and see what we can come up with.

If possible, What UI do plan to connect this with?

The plan is to connect it with some kind of a map. What about you?

We want to connect it with a spatial environment which could be either 2d or 3D. We are looking also into videogame frameworks like Unity which have spatial audio already built in.

Map you mean a geo map?

Btw nobody has still answered… there has to be a way of controlling the volume of the different audio streams…

Sounds like a cool project!

No, more like a 2D map of a room.

Yeah, I really hope its possible!

@rurogge I don’t know if your still looking for a solution, but I found one after looking into jitsi meets react source code. You can easily change the volum that’s beeing rendered by setting the volume attribute of the HTML dom element. Hope that helps and good luck with your project :slight_smile:

2 Likes

If any of you end up with a working solution, please keep us posted. I have been working in distance learning and remote working solutions for years, and what you are working on is key, in my opinion, to recreating online informal conversation in, before and after larger meetings.

Be it for distance learning, remote business meetings, or even online social gatherings amongst friends or family (numerous during the present coronavirus situation), it would be a huge improvement to be able to gather all together in a larger group conference but still, as the conversation progresses, move closer to one or a few individuals in the group (at the break, or because you want to discuss informally with a person or subgroup without “taking the stage” with the whole group).

Contrary to moving the conversation to a private webconferencing channel, being able to overhear, not too loudly, other subgroup’s conversations allow for making links between people and projects and ideas that would not have been thought of otherwise…

Plus it is not as intimidating, in certain contexts, to get closer to someone (say the professor or the boss’s boss) to discuss somthing when compared to outright call them to a private meeting.

Anyways, I think you guys are working on the key to webconferencing’s next level, at least that is my opinion as someone who is less a computer scientist and more into the psychology of people in a gathering , a class, or a meeting!

Keep it up and keep us posted if you would like!

1 Like

RemoteVideo.js

there’s a code block that reads:

    /**
     * Change the remote participant's volume level.
     *
     * @param {int} newVal - The value to set the slider to.
     */
    _setAudioVolume(newVal) {
        if (this._audioStreamElement) {
            this._audioStreamElement.volume = newVal;
        }
    }

i’m not sure where this is in the whole software, but it appears to have a volume slider?

oh i think the volume slider is for sharing youtube videos.

I’ve done this in my own project using the IFrame API: https://github.com/capnmidnight/Calla

It takes modifying the default Jitsi Meet installation’s index.html. I include instructions on how to do that on my README.

I originally did only volume scaling, but I’m now doing fully spatialized audio. My file etc/jitsihax.js has the logic. You can use it as-is, or you can delete the majority of the code and reuse only the part that captures the audio element, using the RPC events to modify the volume of it. If you look through the history of the file, you’ll find an old version that did only concern lime.

Or give me a day or two and I will add the volume-only path back in as an option. The fully spatialized audio has been a little difficult to get right and I think I want to have simple volume scaling as a fallback.

Hi capnmidnight
Would you mind explaining how you have done the volume scaling? I run jitsi via API in an Iframe and would need to mute that iframe. I tried to check your jitsihax.js file on your github account but unfortunately it was deleted 2 days ago.
Is there an easy way to mute the sound output of jitsi?

Thanks in advance!

Yeah, jitsihax.js is gone now because Calla no longer uses the IFrame API, it uses lib-jitsi-meet so it can have full, direct access to all of the media tracks that Jitsi creates. Specifically, there is no way to get access to the video feed with the IFrame API.

You can look through the commit history to find jitsihax.js again. Probably best to go with one of the earliest versions if all you’re after is an understanding of how it works: https://github.com/capnmidnight/Calla/blob/10e2f52b6e7186bfa5fc2e2bae2301b6fdab1615/jitsihax.js

You need to edit the index.html file of Jitsi Meet to include that script file.

And then this is how you would communicate with it, for an app running on top of the IFrame: https://github.com/capnmidnight/Calla/blob/10e2f52b6e7186bfa5fc2e2bae2301b6fdab1615/index.html#L415-L421

This “worked” for me, for a time, because the IFrame API is easier to use than lib-jitsi-meet. The documentation on both is not very good, but the IFrame API does a lot more for you, on account of it being just an RPC system for controlling an alread-implemented teleconferencing app, versus lib-jitsi-meet being a library to create a teleconferencing app.

But ultimately, doing things in this way became a maintenance and feature-implementation nightmare. Managing the events back and forth to jitsihax.js, not having direct control over the lifecycle, etc, just made building Calla in the long-term more difficult than necessary.

Which is another reason why Calla started on the IFrame API: I never expected to be working on it long-term. It was originally intended to just be a proof-of-concept, but the idea seems to have legs, so I guess I’m sticking with it.

Right now, Calla is a single app, but I am in the processes of turning it into a library for creating spatialized teleconferencing apps, with the “game” portion of it implemented separately. There are a lot of problems with Jitsi’s APIs: documentation, an obviously “organic” design approach, defects and logical inconsistencies with workflow. So maybe Calla can paper over that for a lot of people, provide something as easy to use as the IFrame API without the restrictions of it.

1 Like

Thank you very much for the explanation! I’ll give it a try. I simply need to mute the local audio output (e.g. the speaker or headphone) of the jitsi iframe, so I’ll try it with setVolume. My first approach was to use setAudioOutputDevice() pointing to an non-existing output device which also would lead in muting the sound output but this is a really ugly way of muting an output

Hello,
Could you show more details please?