when is ん pronounced as "m"?


I've been initially told that ん is always pronounced like the **n** in pi
**n** k. But I've been looking at this wikipedia page:
<https://en.wikipedia.org/wiki/Help:IPA_for_Japanese#cite_note-stop-2>

And it is saying that the ん in words like せ **ん** ぱい is pronounced as **m** as
in **m** uch.

So is there any way to know if I should pronounce ん as **n** or **m** in a
word?




ん 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).




ん 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).

