Refactor AudioPlayer class.