The Wire primarily utilizes source cues rather than overlaying songs on the soundtrack, or employing a score. Source cues constitute music that emanates from an element within the scene, like a jukebox or car radio. This practice is rarely but occasionally breached, notably for the end of season montages and occasionally with a brief overlap of the closing theme and the final shot.
The opening theme is "Way Down in the Hole", a gospel- and blues-inspired song originally written by Tom Waits for his 1987 album Franks Wild Years. Each season uses a different recording of it against a different opening sequence, with the theme being performed, in order, by the Blind Boys of Alabama, Waits himself, the Neville Brothers, "DoMaJe" and Steve Earle. Season four's version of "Way Down in the Hole" was arranged and recorded specifically for the show, and is performed by five Baltimore teenagers: Ivan Ashford, Markel Steele, Cameron Brown, Tariq Al-Sabir, and Avery Bargasse. Earle, who performed the fifth season's version, is also a member of the cast, playing the recovering drug addict Walon. The closing theme is "The Fall", composed by Blake Leyh, who is also the show's music supervisor.
During season finales, a song is played before the closing scene in a montage showing the major characters' lives continuing in the aftermath of the narrative. The first season montage is played over "Step by Step" by Jesse Winchester, the second "I Feel Alright" by Steve Earle, the third "Fast Train" written by Van Morrison and performed by Solomon Burke, the fourth "I Walk on Gilded Splinters" written by Dr. John and performed by Paul Weller, and the fifth uses an extended version of "Way Down In The Hole" by the Blind Boys of Alabama, the same version of the song used as the opening theme for the first season. While the songs reflect the mood of the sequence, their lyrics are usually only loosely tied to the visual shots. In the commentary track to episode 37, "Mission Accomplished", executive producer David Simon said: "I hate it when somebody purposely tries to have the lyrics match the visual. It brutalizes the visual in a way to have the lyrics dead on point. ... Yet at the same time it can't be totally off point. It has to glance at what you're trying to say."
Two soundtrack albums, called The Wire: And All the Pieces Matter -- Five Years of Music from The Wire and Beyond Hamsterdam, were released on January 8, 2008 on Nonesuch Records. The former features music from all five seasons of the series and the latter includes local Baltimore artists exclusively.