I\'m trying to send command via pipe to mplayer when running it under slave mode like this:
import subprocess, time
# start mplayer
song = \'mysong.mp3\'
cmd
I'm now doing it this way and I start to get output:
while True:
cmd = '\nget_meta_artist\n'
p.stdin.write(cmd)
output = p.stdout.readline()
print("output: {}".format(output.rstrip()))
sys.stdout.flush()
Although I still need to figure out a way to bypass the first flush of mplayer's own initialization stdout but I consider my problem solved.
Thanks to glglgl for giving me useful hints.