Terraria item ID 571. Terraria 1.4.5.7.
The Music Box is a Hardmode accessory and furniture item that can be purchased from the Wizard for 10 Gold. When the Music Box is equipped in an accessory slot, it will record the currently playing in-game music after a randomized delay. This includes tracks being played by other Music Boxes. Once recorded, it will change into one of the Music Boxes listed below. A record sound alerts the player about a completed recording.
Description from the Terraria Wiki.