adjusting volume when using media_list_player_new()
Posted: 18 Jul 2017 17:42
When using vlc.py and media_list_player_new() does anybody know if you can adjust the volume?
I have managed to set the initial volume with a dirty hack of creating a sub_player that uses media_player_new()
and setting audio_set_volume(volume) but once media_list_player_new() is activated, no amount of monkeying around with the sub_player will adjust the volume.
Some stripped down python code:
media_list_player_new() has no audio_set_volume() option, is this an oversight or is the volume meant to be adjusted in some other way?
I have managed to set the initial volume with a dirty hack of creating a sub_player that uses media_player_new()
and setting audio_set_volume(volume) but once media_list_player_new() is activated, no amount of monkeying around with the sub_player will adjust the volume.
Some stripped down python code:
Code: Select all
import vlc
import time
playlist=['/home/rolf/vp1.mp3','/home/rolf/vp.mp3']
inst = vlc.Instance()
sub_player = inst.media_player_new()
player = inst.media_list_player_new()
mediaList = inst.media_list_new(playlist)
player.set_media_list(mediaList)
volume = 60
sub_player.audio_set_volume(volume)
sub_player.play()
playing = set([1,2,3,4])
player.play()
while player.get_state() in playing:
time.sleep(1)