In python 3.4 , I was trying to open a "wav" file using vlc in Linux. Here is my code:
import os,time
os.system("cvlc audio/some.wav")
time.sleep(3) #audio was one and half sec
a = 3+3
print (a)
It plays the audio but then doesn’t do the rest. What should I do to make it do them? more precisely what should I do to close the vlc program?
With solving the problem it will also be very grateful to know is there any easier way to play audio within the code specifically in python 3.4? (platform independent code will be even more grateful!)
So the VLC player doesn't exit. The VLC player has a command line argument to close the player once the song/video has been played.
Source: https://wiki.videolan.org/VLC_command-line_help
Can you try the following?