Duplicating recorded music is pretty much the same as duplicating printed music. If it enjoys copyright protection (in most cases, if it was published in 1923 or later), the "fair use" provisions of copyright law allow some limited duplication for strictly academic purposes, but not a lot. If you're copying a couple of excerpts for a class presentation or term paper, you're probably safe. If you're ripping and burning your way to a home collection, you're not.