Exporting the filepath of all music files to a text file
You might just use find:

find ~/Music &gt; ~/music.txt


Or add for example -iname \*.mp3 to only include files that end with .mp3:

find ~/Music -iname \*.m4a -o -iname \*.mp3 -o -iname \*.flac -o -iname \*.wma &gt; ~/music.txt


If the problem is that your music is scattered throughout your directories and not contained within your ~/Music folder - and if you want to export the paths to a file - then you would want to do this: 

find ~/ -iname \*.m4a -o -iname \*.mp3 -o -iname \*.flac -o -iname \*.wma &gt; ~/Desktop/music.txt