Get basepath from Media source by id?

IS there a way to get the basepath form a media source in a snippet?
I’m using Image+ and need to get the image URL including the path of the media source it uses.
I only know the media source ID so what is the quickest way to get the PATH form a media source?

the snippet addmediasourcepath from here could do that

This might work (assuming that it’s a file media source object):

$ms = $modx->getObject('modFileMediaSource', $mediaSourceId);
$bases = $ms->getBases();

$absolutePath = $bases['pathAbsolute'];
$relativePath  = $bases['pathRelative'];

It might be more correct to call getObject() with the parent class if it works:

$ms = $modx->getObject('modMediaSource', $mediaSourceId);

Tnx Bobray,

that works