title: Autorun python-pygame script doesnt output a sound
body: <p>i'm currently trying to autoboot a python script via rc.local. The python script is about playing a Sound when a button is pressed:</p>
  <pre><code>import RPi.GPIO as GPIO
  import pygame
  import pygame.mixer
  
  GPIO.setmode(GPIO.BOARD)
  GPIO.setup(37, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
  
  pygame.init()
  pygame.mixer.init()
  
  ausgeloest = True # bool for making only a sound after the button was released
  while True:
       if GPIO.input(37) == 0:
             ausgeloest = False
       elif GPIO.input(37) == 1:
             #my code before: pygame.mixer.music.load(&quot;Sound1.wav&quot;)
             #my code before: pygame.mixer.music.play()
             #new code (thanks to the answers):
             music = pygame.mixer.Sound(&quot;/home/pi/soundmachine/Sound1.wav&quot;)
             music.play()
             
             print(&quot;Sound was played&quot;) #for testing purposes
             ausgeloest = True
  </code></pre>
  <p>The script works perfectly in desktop mode, when i run it manually. I've set the default audio-output via right-click on the speaker-sign to analog, because i want to use the 3.5mm output. But as soon as i switch into console-mode (auto-login) and try to run it, there is no audio output.</p>
  <p>Update:
  The error message is now gone and i can see the testing print()-line on the console, but i still can't hear the desired sound... So the script is being executed, but somehow the sound is not hearable.
  How can I solve this problem?</p>