The decline of music piracy holds lessons for other industries.