jech / galene

The Galène videoconference server
https://galene.org
MIT License
942 stars 128 forks source link

Enhancement for audio sliders #37

Open castagnag opened 3 years ago

castagnag commented 3 years ago

Hi,

when a conference starts all the audio sliders are at full throttle. This means that if you are in a conference with N participants and one of them has an audio volume much lower than the others, then you have to lower the audio on N-1 participants and increase the overall volume

would it possible to start with all the audio sliders at half throttle so that in the previous case we can just increase the volume of the single problematic participant please

TIA

Beppe

jech commented 3 years ago

Here's a summary of the discussion on the maling list.

  1. HTMLMediaElement.volume, which is what the volume slider controls, does not go higher than 100%; https://xkcd.com/670/
  2. a simple workaround would be to make the videos start at 70% volume, but that would mean that Galène is less loud than other applications, which could be annoying;
  3. a different UI is therefore needed, such as a global slider that controls all videos' volumes; it's not clear (at least to me) what this UI should look like.
erdnaxe commented 3 years ago

HTMLMediaElement.volume does no go above 100%, but actually the client could route audio through an AudioContext to allow for over-amplification. Is this something that Galène would like to include ?

// Create audio context with a gain node to over-amplify to 120%
const audioCtx = new AudioContext();
const gainNode = audioCtx.createGain();
gainNode.gain.value = 1.2;

// Connect input and output
audioCtx.createMediaElementSource(videoElement).connect(gainNode);
gainNode.connect(audioCtx.destination);

I haven't tested that, but it should work according to https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Using_Web_Audio_API.