Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set volume for only a specific player? #90

Closed
jonafeucht opened this issue Aug 6, 2021 · 8 comments
Closed

How to set volume for only a specific player? #90

jonafeucht opened this issue Aug 6, 2021 · 8 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@jonafeucht
Copy link
Contributor

Say I have two players:
Player player1 = Player(id: 1);
Player player2 = Player(id: 2);

If I change the volume of player1 it will also change the volume for player2, which shouldn't happen.

@DomingoMG
Copy link
Contributor

DomingoMG commented Aug 6, 2021

@jonafeucht It really is a strange thing.

I also had this problem, according to the LibVLC developers they say they should apply how a VLC player works, a separate volume per player.

But I have noticed that the volume is applied to all the players, the solution assigns an output device without being the default and you will be able to manage the volume independently.

It is not the correct solution but it works for me. The ideal is to watch without in C ++ allows you to control the volume independently per player.

Contact the LibVLC developers for this change.
https://github.com/videolan/libvlcpp

@alexmercerind alexmercerind added the enhancement New feature or request label Aug 6, 2021
@alexmercerind
Copy link
Owner

Currently volume control isn't very good. I have to look libVLC APIs before claiming anything. Marking as "good first issue" aswell.

@alexmercerind alexmercerind added the good first issue Good for newcomers label Aug 6, 2021
@DomingoMG
Copy link
Contributor

DomingoMG commented Aug 30, 2021

I have not been able to check it 100%.
On the VLC forums there is a post from a person who has the same problem allocating the volume.

Command line:
This allows playing audio at lower or higher speed without affecting the audio pitch
--aout=direcsound
--aout {any, mmdevice, directsound, waveout, amem, afile, adummy, none}

read more here:
https://forum.videolan.org/viewtopic.php?t=147229

I will try it if it works

@KyleKun
Copy link

KyleKun commented Nov 3, 2021

@DomingoMG could you get it to work?

@DomingoMG
Copy link
Contributor

DomingoMG commented Nov 3, 2021

@KyleKun I currently don't have a solution per player.
I just know that if you assign a different output device to the player it becomes independent without affecting the other player.

It would be necessary to see if @alexmercerind could look for some type of complement that allows to differentiate the volume of the player.

In case of finding a better solution I will post it here.

@trapeye
Copy link

trapeye commented Jan 20, 2022

@KyleKun I currently don't have a solution per player. I just know that if you assign a different output device to the player it becomes independent without affecting the other player.

It would be necessary to see if @alexmercerind could look for some type of complement that allows to differentiate the volume of the player.

In case of finding a better solution I will post it here.

found solution?

@DomingoMG
Copy link
Contributor

DomingoMG commented Jan 29, 2022

@trapeye, @alexmercerind, @KyleKun, @jonafeucht

SOLUTION FOUND:
You will only have to instantiate the player as I indicate and you will be able to adjust the volume independently and with Alex's implementation of setVolume you will change the volume.

I must indicate that I have spent days looking for millions of solutions, it has worked for me, I would appreciate a thumbs up.

COMMAND LINE:

vlc.exe "D:\tracks\Melendi - La Chica Perfecta.mp3" --aout=directsound --directx-volume=0.35

DART:

Player _player1 = Player(id: id, commandlineArguments: ['--aout=directsound', '--directx-volume=0.35']);
_player1.open(....Media.....);
_player1.setVolume(1.0);

Player _player2 = Player(id: id, commandlineArguments: ['--aout=directsound', '--directx-volume=0.35']);
_player2.open(....Media.....);
_player2.setVolume(0.50);

REMOVE INITIAL VOLUME IN C++: DART_VLC/player.h

image

@DomingoMG
Copy link
Contributor

DomingoMG commented Jan 29, 2022

Hi @alexmercerind, you could let the user decide if it's directx-Sound, the setdevice is without {0.0.0.00000000}. and if it is mmdevice it is with {0.0.0.00000000}...

By default when instantiating the player in libvlc without the command line it is type --aout=mmdevice.

mmdevice uses {0.0.0.00000000}.{D267875D-5AEE-4346-AB97-8DDF8D51E28C}
but when using
directsound is directxsound its way of assigning output devices is {D267875D-5AEE-4346-AB97-8DDF8D51E28C}
without the {0.0.0.00000000}.

In the setDevice command ( OPTIONAL )

setDevice(Device device, { bool isDirectxSound = false }){
    if( isDirectxSound ) {
        device.id = {D267875D-5AEE-4346-AB97-8DDF8D51E28C}
    } else {
        device.id = {0.0.0.00000000}.{D267875D-5AEE-4346-AB97-8DDF8D51E28C}
    }
}

It is 100% proven that it works like this.

The documentation indicates that depending on the type it corresponds in one way or another.
This closes this request, allowing the assignment of channels with independent volumes for both types.
image

read more here:
VLC COMMAND LINE

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants