pygame mixer music play(- musicplaying true next you need to load the sound files there are two modules for sound in pygame the pygame mixer module can play short sound effects during the game the pygame mixer music module can play background music call the pygame mixer sound(constructor function to create pygame mixer sound object (called sound object for shortthis object has play(method that when called will play the sound effect when called line calls pygame mixer music load(to load the background music line calls pygame mixer music play(to start playing the background music the first parameter tells pygame how many times to play the background music after the first time we play it so passing will cause pygame to play the background music times - is special valueand passing it for the first parameter makes the background music repeat forever the second parameter to pygame mixer music play(is the point in the sound file to start playing passing will play the background music starting from the beginning passing for the second parameter will start the background music two and half seconds from the beginning finallythe musicplaying variable will have boolean value that tells the program if it should play the background music and sound effects or not it' nice to give the player the option to run the program without the sound playing toggling the sound on and off if event key =ord(' ')if musicplayingpygame mixer music stop(elsepygame mixer music play(- musicplaying not musicplaying the key will turn the background music on or off if musicplaying is set to truethen the background music is currently playing and we should stop the music by calling pygame mixer music stop(if musicplaying is set to falsethen the background music isn' currently playing and should be started by calling pygame mixer music play(finallyno matter whatwe want to toggle the value in musicplaying toggling boolean value means to set to the opposite of its current value the line musicplaying not musicplaying sets the variable to false if it is currently true or sets it to true if it is currently false think of post questions to