media_stop should work fine, just make sure you have a handle to the sound that you are playing...

Code:
var handle;
handle = media_loop("music.mp3",null,50);
...
media_stop(handle);