0

i use this line for my game

playsound(os.path.join(os.path.dirname(__file__) , 'asset', C1 + '.mp3'))

it's work well on linux but on windows i get output:

raise PlaysoundException(exceptionMessage)
playsound.PlaysoundException: 
    Error 275 for command:
        open "E:\test\asset\sound3.mp3" alias playsound_0.4871568054138944
    Cannot find the specified file.  Make sure the path and filename are correct

when i type full path

Error 277 for command:
        open "E:\JPssetound3.mp3" alias playsound_0.511238440569949
    A problem occurred in initializing MCI.
Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
Blaplafla
  • 9
  • 3
  • Does it work if you hardcode the path instead? – drum Aug 22 '20 at 03:59
  • Try converting to a wav file and check if that plays. – Mike67 Aug 22 '20 at 04:17
  • Does this answer your question? ["A problem occurred in initializing MCI" playsound issues](https://stackoverflow.com/questions/56627901/a-problem-occurred-in-initializing-mci-playsound-issues) – Tomerikoo Oct 04 '21 at 16:44

1 Answers1

0

Check if the file exists in a command prompt or File Explorer. The file should be present in the folder you are expecting.

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
GManika
  • 505
  • 1
  • 6
  • 13
  • Did you check if the file is NOT corrupted by playing the file using windows media player? Covert to WAV file to try? p.s. https://stackoverflow.com/questions/56627901/a-problem-occurred-in-initializing-mci-playsound-issues – GManika Aug 22 '20 at 18:42
  • I use k lite to open and it's well: os.system('start mpc-hc64.exe asset/"' + C1 + '.mp3') – Blaplafla Aug 23 '20 at 04:25