Want to play audio on your Raspberry Pi running Raspbian, while logged in to a non-root user account? Me, too!
Seems like such a simple task.
Consider the following code snippet using PyGame:
while pygame.mixer.music.get_busy() == True:
Let's try it:
$ python soundtest.py
Traceback (most recent call last):
File "./soundtest.py", line 3, in <module>
pygame.error: No available audio device
But, if you run the script using sudo, it plays as expected.
The solution? Add non-root users to the `audio` group  in order to play audio.
$ sudo usermod -a -G audio <username>
Important: Log out of the user account, then log in again in order to force the new group membership to take effect.