Skip to content
Advertisement

How to change VLC-python output device?

In my project, I need to get sound from a radio stream URL and play it. But it needs to be played in a specific output device called “VB-Cable Input (Virtual Audio Cable)”.

I couldn’t find a way to do it. This is my current code:

JavaScript

I searched through StackOverflow and the VLC documentation, but couldn’t get the result I expected, I believe I’m using the functions in the wrong way.

Advertisement

Answer

After some research, I found this implementation of audio_output_device_set() in GitHub

As @RandomDavis said, the problem was indeed in this function. All I had to do was switching the first argument to None and leave the rest as it is.

This is the correct code:

JavaScript

Still not quite sure why inserting any values other than None makes the function invalid. But the problem is now solved.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement