Most DS games use the SDAT sound format, said format containing 3 sub formats that cover the main styles of computer based music
SSEQ (along with sbnk for the sample bank) is a midi/sequencer/tracker formats.
SWAV Small wave files seen in sound clips
STRM Larger wave files that contain full songs.
There are other formats, however they are very rare (ignoring region dupes I might still be able to count games/franchises on my fingers) and I tried to document all I know of in
http://gbatemp.net/threads/the-various-audio-formats-of-the-ds.305167/
Most of the time the other formats are well known or fairly close to the hardware/wave files.
Three main methods of ripping SDAT.
Old methods.
SSEQ2midi (various versions), ndssndext, crystaltile2 and so forth. Linked in various threads or just a search away. Some games will sound good, others less so. Things like crystaltile2, tinke and possibly mkds course modifier have some good stuff.
VGMtrans.
Able to make midi files and rip sbnk files to DLS (another sound bank format more common on the PC). This means you can make things sound pretty much like they would on the DS where the old methods above certainly have their uses but are not going to be exact.
https://github.com/vgmtrans/vgmtrans/releases for the newer stuff, older stuff exists elsewhere and might work if this has some unexpected bugs.
rip 2sf files with whatever, most using VGMtoolbox (
https://sourceforge.net/projects/vgmtoolbox/ and
https://www.hcs64.com/mboard/forum.php?showthread=22580 . You sort of emulate the format back on PC so you will need the 2sf playback plugins to go with them and they will only work with things like foobar.
http://www.zophar.net/utilities/2sf/vio2sf.html
I am not sure how hard it is to get the extra plugins/rip kit that snakemeat and caitsith2 have for ripping 2sf files right now.
Alternative. If you want to play them back on the DS then maybe have a look at
http://gbatemp.net/threads/nds-music-player.306997/