Answer to your question is not exactly "NO",
and you are right whatsapp uses hack for this,
whatsapp someyow use AudioAgent, as they are allowed to run in background,
i dont know how exactly they do it, i am also searching for the same answer, let's see if i find something will post here