Skip to content

Commit be44865

Browse files
committed
Change file location of audio file
1 parent ca8ac9d commit be44865

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

applications/game.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from scipy.signal import welch
88
from scipy.integrate import simpson
99
import time
10+
import os
1011

1112
# Pygame Initialization
1213
pygame.init()
@@ -30,7 +31,11 @@
3031
title_font = pygame.font.SysFont('Arial', 72, bold=True)
3132

3233
# Load win sound effect
33-
win_sound = pygame.mixer.Sound("C:\\Users\\PAYAL\\BioAmp-Tool-Python\\applications\\brass-fanfare-with-timpani-and-winchimes-reverberated-146260.wav")
34+
# win_sound = pygame.mixer.Sound("C:\Users\PAYAL\BioAmp-Tool-Python\applications\media\brass-fanfare-with-timpani-and-winchimes-reverberated-146260.wav")
35+
# Load win sound effect using a cross-platform path
36+
base_path = os.path.dirname(__file__) # Get the directory of the current script
37+
sound_path = os.path.join(base_path, "media", "brass-fanfare-with-timpani-and-winchimes-reverberated-146260.wav")
38+
win_sound = pygame.mixer.Sound(sound_path)
3439

3540
# Ball properties
3641
ball_radius = 20

0 commit comments

Comments
 (0)