def extract_songs_metadata(xml_source):
    """ Create the dictionary containing the music metadata."""
    songs_and_meta = {}
    for song in xml_source.get_all_songs():
        key = xml_source.get_aat(song)
        rating = '0'
        rating_el = xml_source.get_rating(song)
        if rating_el is not None and rating_el.text is not None:
            rating = rating_el.text
        playcount = '0'
        playcount_el = xml_source.get_playcount(song)
        if playcount_el is not None and playcount_el.text is not None:
            playcount = playcount_el.text
        songs_and_meta[key] = {'rating': rating, 'playcount': playcount}
    return songs_and_meta
