I'm trying to play a sound using the python playsound command. It works when I try the following:
from playsound import playsound
playsound("C:/filepath1.mp3")
However, it doesn't seem to work with dictionaries.
NotePaths = {"C" : "C:.../filepath1.mp3"}
playsound([NotePaths["C"]])
This returns the following error and opens the playsound.py module:
Traceback (most recent call last):
File "C:...Musical Quiz.py", line 27, in <module>
playsound([NotePaths["C"]])
File "C:UsersUsernameAppDataLocalProgramsPythonPython38libsite-packagesplaysound.py", line 35, in _playsoundWin
winCommand('open "' + sound + '" alias', alias)
TypeError: can only concatenate str (not "list") to str
Am I doing something wrong, or is there no such function in the playsound command? It would also be great if someone could point me to a library that can play a sound using a dictionary/if anyone knows of a different way to link filepath1.mp3 to C that is compatible to the playsound command.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…