To extract sounds (or graphics) from a ROM, you’ll need the ndstool and ndssndext.
First extract the game data from ROM:
ndstool -x -d data <filename>.ndsCode language: HTML, XML (xml)
This will create a new directory data containing all the game data. In there you’ll most probably find a file *.sdat somewhere. This is a sound archive format. Now run this through the ndssndext (I had to use WinE):
wine ndssndext.exe sound_data.sdatCode language: CSS (css)
This creates a new folder which contains more folders with the actual contents from the .sdat-file. These can be MIDI files and/or (converted) WAV files.