Skip to content

Instantly share code, notes, and snippets.

@curzona
Created November 10, 2015 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save curzona/0faae09354f31dd2c27b to your computer and use it in GitHub Desktop.
Save curzona/0faae09354f31dd2c27b to your computer and use it in GitHub Desktop.
vlc_audio_output_device_switching
import vlc
import time
p = vlc.MediaPlayer("organfinale.wav")
p.play()
device = p.audio_output_device_enum()
while device:
print "playing on..."
print device.contents.device
print device.contents.description
p.audio_output_device_set(None, device.contents.device)
time.sleep(3)
device = device.contents.next
p.stop()
@curzona
Copy link
Author

curzona commented Nov 10, 2015

Traceback occurs with older versions of VLC

Traceback (most recent call last):
  File "vlc_audio_output_device_switching.py", line 8, in <module>
    device = p.audio_output_device_enum()
  File "C:\Users\adcurzon\Desktop\hello_libvlc_python\env\lib\site-packages\vlc.py", line 3674, in audio_output_device_enum
    return libvlc_audio_output_device_enum(self)
  File "C:\Users\adcurzon\Desktop\hello_libvlc_python\env\lib\site-packages\vlc.py", line 6241, in libvlc_audio_output_device_enum

    ctypes.POINTER(AudioOutputDevice), MediaPlayer)
  File "C:\Users\adcurzon\Desktop\hello_libvlc_python\env\lib\site-packages\vlc.py", line 246, in _Cfunction
    raise NameError('no function %r' % (name,))
NameError: no function 'libvlc_audio_output_device_enum'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment