I am trying to use python to close VLC while it is recording audio. Currently I am using:
os.kill(pid,pid)
This works but is closing VLC abruptly and not allowing the recording file to close properly, thus corrupting it. If I manually close the VLC GUI instance than the recording file will not be corrupted.
So basically I am looking for a python command to close an application that emulates the 'Close' button on the application's GUI.
Or, perhaps there is another way. Such as closing the .wav file where the recording is being written, before killing the VLC process? I also put some work into this, but didn't get any results.
Thanks for the help!
os.kill(pid, sig))