Large crowds are challenging the comfort and safety level of big cities, while music may be a potential method to improve pedestrian flow. This paper focuses on the influence of different tempos and types of background music on pedestrian dynamics. Three tempos (90[Formula: see text]beats/min (BPM), 120[Formula: see text]BPM and 150[Formula: see text]BPM) and two types (pure music and metronome stimuli) of music are considered. It is found that more frequent stop-and-go behaviors emerge with rhythms. Compared with that under a low tempo (90[Formula: see text]BPM) of rhythm condition, stopping is more frequent with a high tempo one (120[Formula: see text]BPM or 150[Formula: see text]BPM). The number of stopping pedestrians per unit time increases 68.57%, 376.00%, 298.29%, 224.00%, 438.29% and 393.71% with 90 BPM, 120[Formula: see text]BPM and 150[Formula: see text]BPM music, 90[Formula: see text]BPM, 120[Formula: see text]BPM and 150[Formula: see text]BPM metronome, compared with that without any rhythm, respectively. The velocity and flow are lower, and higher local densities appear with background music. The step frequency at high density with rhythms ([Formula: see text], [Formula: see text] and [Formula: see text][Formula: see text]Hz for 90[Formula: see text]BPM, 120[Formula: see text]BPM and 150[Formula: see text]BPM music; [Formula: see text], [Formula: see text] and [Formula: see text][Formula: see text]Hz for 90[Formula: see text]BPM, 120[Formula: see text]BPM and 150[Formula: see text]BPM metronome) is lower than that without any rhythm ([Formula: see text][Formula: see text]Hz). Pedestrians need more time to avoid collisions and to step under background music conditions, because they are influenced by the music and not fully focusing on walking. As a result, step frequency decreases and stopping behavior is more frequent. This in turn leads to the decrease of the velocity and flow and the emergence of higher local densities. Our study will be helpful for understanding the effect of background music on pedestrian dynamics.