pygame draw lines()except they will draw anti-aliased (smoothlines instead of aliased (blockylines playing sounds playing sounds that are stored in sound files is even simpler than displaying images from image files firstyou must create pygame mixer sound object (which we will call sound objects for shortby calling the pygame mixer sound(constructor function it takes one string parameterwhich is the filename of the sound file pygame can load wavmp or ogg files the difference between these audio file formats is explained at to play this soundcall the sound object' play(method if you want to immediately stop the sound object from playing call the stop(method the stop(method has no arguments here is some sample codesoundobj pygame mixer sound('beeps wav'soundobj play(import time time sleep( wait and let the sound play for second soundobj stop(you can download the beeps wav file from the program execution continues immediately after play(is calledit does not wait for the sound to finish playing before moving on to the next line of code the sound objects are good for sound effects to play when the player takes damageslashes swordor collects coin but your games might also be better if they had background music playing regardless of what was going on in the game pygame can only load one music file to play in the background at time to load background music filecall the pygame mixer music load(function and pass it string argument of the sound file to load this file can be wavmp or midi format to begin playing the loaded sound file as the background musiccall the pygame mixer music play(- function the - argument makes the background music forever loop when it reaches the end of the sound file if you set it to an integer or largerthen the music will only loop that number of times instead of looping forever the means to start playing the sound file from the beginning if you pass larger integer or floatthe music will begin playing that many seconds into the sound file for exampleif you pass for the second parameterthe sound file with begin playing at the point seconds in from the beginning