1. pygame
  2. Untitled project
  3. pygame


pygame / examples / sound.py

Diff from to

File 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]
+    file = os.path.join('data', 'secosmic_lo.wav')
 sound = mixer.Sound(file)