-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switched music paths to ensure windows compatibility #214
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not work on every map.
Tested works in Pokete Center
.
Does not work in NiceTown
or Fightmap
:
Stacktrace for NiceTown
Error 305 for command:
open "C:\Users\maxfe\AppData\Local\Temp\PS_4klm1ho.mp3"
Cannot specify extra characters after a string enclosed in quotation marks.
Error 263 for command:
close "C:\Users\maxfe\AppData\Local\Temp\PS_4klm1ho.mp3"
The specified device is not open or is not recognized by MCI.
Failed to close the file: "C:\Users\maxfe\AppData\Local\Temp\PS_4klm1ho.mp3"
Process Process-3:
Traceback (most recent call last):
File "C:\Users\maxfe\AppData\Local\Programs\Python\Python310\lib\multiprocessing\process.py", line 315, in _bootstrap
self.run()
File "C:\Users\maxfe\AppData\Local\Programs\Python\Python310\lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\maxfe\pokete\pokete_classes\audio.py", line 18, in audio_fn
playsound(MUSIC_PATH / song)
File "C:\Users\maxfe\AppData\Local\Programs\Python\Python310\lib\site-packages\playsound.py", line 44, in _playsoundWin
_playsoundWin(tempPath, block)
File "C:\Users\maxfe\AppData\Local\Programs\Python\Python310\lib\site-packages\playsound.py", line 72, in _playsoundWin
winCommand(u'open {}'.format(sound))
File "C:\Users\maxfe\AppData\Local\Programs\Python\Python310\lib\site-packages\playsound.py", line 64, in winCommand
raise PlaysoundException(exceptionMessage)
playsound.PlaysoundException:
Error 305 for command:
open "C:\Users\maxfe\AppData\Local\Temp\PS_4klm1ho.mp3"
Cannot specify extra characters after a string enclosed in quotation marks.
WTF |
pokete_classes/audio.py
Outdated
try: | ||
from playsound import playsound | ||
except ModuleNotFoundError: | ||
from .dummy_playsound import playsound | ||
from .settings import settings | ||
|
||
|
||
MUSIC_PATH = __file__.replace("pokete_classes/audio.py", 'assets/music/') | ||
MUSIC_PATH = Path(__file__).parent.parent / 'assets' / 'music' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just FYI, should be able to do Path(__file__).parents[1]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes, that's a good tip.
Co-authored-by: Mustafa Quraish <[email protected]>
I wonder where this path comes from. |
And there seams to be a problem with playsound: TaylorSMarks/playsound#98 |
Best option would be to enforce |
I now went through the pain of setting up a windows vm and finly fixing audio for windows
I now went through the pain of setting up a windows vm and finally fixing |
It now does not rely on pynput anymore. At all. |
That looks like common windows BS and may not be related to Pokete at all. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from this one comment, everything looks good!
Co-authored-by: MaFeLP <[email protected]>
Please test @MaFeLP .