I used pygame and mplayer library to play a m4a music file in python languages,but all failed. Is there a library i can use to play m4a file in python?
here is my code:
pipes = dict(stdin=PIPE, stdout=PIPE, stderr=PIPE)
mplayer = Popen(["mplayer", r"C:\Users\sam\PycharmProjects\untitled\music.m4a"], **pipes)
# to control u can use Popen.communicate
mplayer.communicate(input=b">")
sys.stdout.flush()
i used the pycharm ,and the result is : Traceback (most recent call last): File "C:/Users/sam/PycharmProjects/untitled/tt.py", line 23, in mplayer = Popen(["mplayer", r"C:\Users\sam\PycharmProjects\untitled\music.m4a"], **pipes) File "C:\Users\sam\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", line 707, in init restore_signals, start_new_session) File "C:\Users\sam\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", line 990, in _execute_child startupinfo) FileNotFoundError: [WinError 2] 系统找不到指定的文件。