What do you mean by cache?
Cache the names in a second list / array, or buffer the actual song files in memory or a disk folder?
Please describe your problem in detail.
If this is a homework assignment post the professor's exact assignment not your paraphrasing of it. Also post what work you've done so far, and exactly what parts of the assignment you have problems with.