Hi. I'm maintaining a java legacy project involving vlc.
For compatibility reasons, we have to do the following:
We place the VLC (almost) entire player in a subdirectory of our project, like this:
And from our java class constructor, we create a ProcessBuilder with the vlc.exe as command, and we create a Process by doing a ProcessBuilder.start().
Then we create a printStream to send commands to vlc, and a BufferedReader to receive whatever vlc logs or prints on console. We also create and start a thread with that process.
While running, we send commands to vlc with in.print() + in.flush(). Examples: «in.print("video.mov\n"); in.flush();» or «in.print("play\n"); in.flush();»
Almost all commands work fine. But the videos we are playing are playing sound at 0 volume. They are not muted, the volume value is zero. You can see in the following capture that the Windows Sound Control of the VLC player does not have the volume icon crossed out, it's just that the volume slider is at the zero step, at the bottom. But the sound, as represented by the little grey bar on the left of the slider, is being played:
The one command that doesn't seem to work is setVolume. We try «in.print("setVolume 100\n"); in.flush();». In the logs we always see an "OK setVolume", but it's always followed by one or two "simple volume changed: 0.000000, muting disabled", maybe not inmediately but less than 100 milliseconds and a few other instructions after the OK.
If we manually move the Windows Sound Slider, the audio volume adjusts accordingly, and in the logs we see one of this messages showing the volume on a per unit basis (example: We put the slider at the top, at the 100 step, we see at the log a "simple volume changed: 1.000000, muting disabled" line; if we put the slider at the 67 step, we see a "simple volume changed: 0.670000, muting disabled" line.
We have tried to send the setVolume command with a non-integer number also, for example «in.print("setVolume 0.5"); in.flush();», but it goes the same way: OK setVolume followed by simple volume changed: 0.000000
It's as if vlc reacted to a setVolume command by resetting the volume to zero again.
Has anybody some clue about this behaviour of vlc?
Thanks in advance.