Click here to Skip to main content
14,829,523 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i installed the playsound module successfully but when i am trying to run it's showing:

File "C:\Users\KIIT\AppData\Local\Programs\Python\Python39\lib\site-packages\playsound.py", line 31, in winCommand
    raise PlaysoundException(exceptionMessage)
playsound.PlaysoundException:
    Error 275 for command:
        open "C:\Users\KIIT\Downloads\note.mp3" alias playsound_0.06501936339126946
    Cannot find the specified file.  Make sure the path and filename are correct.


What I have tried:

I have cross checked a hundred times to check whether I made some fault somewhere but I am absolutely sure that the path and the file name are accurate. while i was searching for a solution i came across a guy who faced the same problem a year back and someone replied to him that he needs to check the path and the filename and be accurate about that, but i guess its not the solution. please help me out i really want to know what is wrong with the module.
Posted
Updated 30-Jan-21 8:08am

An easy way to get the path without typing it is to use Explorer and navigate to the file you want to play. Hold down Shift then right-click the file you want to play and pick "Copy as path".

Paste that path into your code.
   
Comments
11Psm32 30-Jan-21 14:37pm
   
thank you so much for helping me out but i just realised that the problem was not in the path or the specified file name. i was using a mp3 file whichh size exceeded 12mb but i tried to use a mp3 of relatively smaller size like 985 kb and it worked.
If you are absolutely sure that the file name and path are correct, then the next thing to check is the environment

If the app is web based, then you need to check where the code is running. Python is executed on the server for this, and JS is run on the client - but if your app is compiled to JS then the path would be client not server.

There is also the environment permissions: does the user executing the file have permission to access the full folder path to the file? Because if it doesn't, it can't read it. Note that the user accessing the file may not be the same as you if your package uses a different process to play sound, which is possible.

I'd copy the file to a new folder that has read / write access for absolutely everyone and see if that improves the situation. If it does, then you can look to environmental factors - if it doesn't then you probably need to look at talking to the people you got the package from.
   
Comments
11Psm32 30-Jan-21 14:41pm
   
thanks @originalgriff i was struggling to find the root cause of this problem but i just tried a relatively smaller mp3 file and it worked. earlier i was using a mp3 file whose size exceeded 12mb but when i tried with a file of 985kb it worked. i guess larger files are not getting identified or something else! what's you opinion? why the files with larger size are not able to get identified?
OriginalGriff 30-Jan-21 15:00pm
   
You'd probably have to ask the people who wrote the package - but MP3 isn't a music file format, it's a container that should contain a single MPEG-1 or MPEG-2 Audio Layer III encoded track - but I've seen "MP3 files" that aren't really.
It's possible that the package just can't play whatever it is!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900