Source

pygame / examples / sound.py

Diff from to

examples/sound.py

 don't even bother loading all of the pygame package. Just
 pick the mixer for sound and time for the delay function."""
 
-import os.path
+import os.path, sys
 import pygame.mixer, pygame.time
 mixer = pygame.mixer
 time = pygame.time
 
 
 #load the sound    
-file = os.path.join('data', 'secosmic_lo.wav')
+
+if len(sys.argv) > 1 and "wav" in sys.argv[1]:
+    file = sys.argv[1]
+else:
+    file = os.path.join('data', 'secosmic_lo.wav')
 sound = mixer.Sound(file)