vlc.py audio_output_enumerate_devices()

This forum is about all development around libVLC.
cen
New Cone
New Cone
Posts: 9
Joined: 13 Jan 2014 12:17

vlc.py audio_output_enumerate_devices()

Postby cen » 13 Jan 2014 12:44

Hello,

how to get audio_output_enumerate_devices() working.

Code: Select all

print "vlc, list? " self.Instanze = vlc.Instance() list = self.Instanze.audio_output_enumerate_devices() for device in list: print "name {}\ndevices {}\ndescription {}\n ".format(device['name'],device['devices'],device['description'])
With __version__ = "N/A"
build_date = "Tue Jul 2 10:35:53 2013" I get
list = self.Instanze.audio_output_enumerate_devices()
File "path/vlc.py", line 1388, in audio_output_enumerate_devices
for d in range(libvlc_audio_output_device_count (self, i.name))]
NameError: global name 'libvlc_audio_output_device_count' is not defined
With __version__ = "N/A"
build_date = "Mon Sep 10 16:51:25 2012" I get
name alsa
devices []
description ALSA audio output
...

if I do a

Code: Select all

Instanze.mediaplayer.audio_output_get_device_type()
after starting a film, I get -1

My aim is to use
audio_output_device_set(self, psz_audio_output, psz_device_id)
for setting the audio aoutput

as a workoround I use

Code: Select all

playVlc("--aout=alsa --alsa-audio-device=hdmi:CARD=NVidia,DEV=0") def playVlc(self, audio=""): self.instance = vlc.Instance(audio)
as described in an other thread. (getting the setting from parsing ~/.config/vlc/vlcrc)

cen
New Cone
New Cone
Posts: 9
Joined: 13 Jan 2014 12:17

Re: vlc.py audio_output_enumerate_devices()

Postby cen » 12 Feb 2014 20:33

unluckily this workaround does not work for winXP. ("aout=aout_directx --directx-audio-device=NVIDIA High Definition Audio")
I tried al sorts of "" and '' combinations.
Using the '--connfig vlcrc' commandline parameter does not work with linux("--connfig=/path/vlcrc") or windows vlc.Instance("--connfig=C:\vlcrc1")

so I come back to the question, why
i=vlc.Instance
list=i.audio_output_enumerate_devices()
gives me a NameError: global name 'libvlc_audio_output_device_count' is not defined.

Any hints how to use two soundcards under Windows?

cen
New Cone
New Cone
Posts: 9
Joined: 13 Jan 2014 12:17

Re: vlc.py audio_output_enumerate_devices()

Postby cen » 13 Feb 2014 11:43

well, I got things working a bit further. choosing soundcard with output of instance.audio_output_enumerate_devices() works at least under linux
There is the question left, why it works with the old build 'Mon Sep 10 16:51:25 2012', but not with the actual one 'Tue Jul 2 10:35:53 2013'

choosing soundcard:
instance = vlc_sep2012.Instance()
mediaplayer = instance.media_player_new()
list=instance.audio_output_enumerate_devices()
name = list[3]['name'] #in my case 'alsa'
device= list[3]['devices'][20]['id'] # in my case 'hdmi:CARD=NVidia,DEV=0'
mediaplayer.audio_output_set(name)
mediaplayer.audio_output_device_set(name,device)
media = self.instance.media_new(unicode(path to file)
mediaplayer.play()

there are two other threads or so handeling this isue only using

Code: Select all

mediaplayer.audio_output_device_set
it needs

Code: Select all

mediaplayer.audio_output_set(name) mediaplayer.audio_output_device_set(name,device)
doeas the job.
phu :-) finaly


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 21 guests