This is my code https://raw.githubusercontent.com/T-Dynamos/Python-Games/master/Connected/main.py
Here's repo https://github.com/T-Dynamos/Python-Games/tree/master/Connected
This is logcat error:
2022-05-15 22:25:30.762 7724 7748 com.pyguru.connected I python : pygame.error: Unable to open file '/data/data/com.pyguru.connected/files/app/Sounds/flip.mp3'
Here's the fix i tried but not worked
def fileR(filename):
return os.path.join(os.path.dirname(os.path.abspath(__file__)),filename)
After this function
flip_fx = pygame.mixer.Sound(fileR('Sounds/flip.mp3'))
After adding
import os
try:
print(os.listdir("/data/data/com.pyguru.connected/files/app/Sounds/"))
print(os.path.exists("/data/data/com.pyguru.connected/files/app/Sounds/flip.mp3"))
except Exception as e:
print(str(e))
To code i got this
2022-05-15 23:22:31.687 29920 29942 com.pyguru.connected I python : ['bgm.mp3', 'dead.mp3', 'flip.mp3', 'point.mp3', 'score_page.mp3']
2022-05-15 23:22:31.688 29920 29942 com.pyguru.connected I python : True