assimilates to the consonantal sounds that follow. If it is followed by 't' or 'd', then it is pronounced like an 'n'. If it is followed by 'p' or 'b', it is pronounced like 'm'. If followed by 'k' or 'g', then like 'ng' from 'sing'.
If is not followed by a consonant, then there isn't really a true English equivalent; it's more or less its own syllabic 'n'.
But technically, is never quite pronounced as in English since it always constitutes a mora. So, in the example you gave consists of four beats, and is pronounced more like 'se.mm.pa.i' (4 moras) than 'sem.pai' (2 syllables).