How to stop the speaker totally I know this sounds weird, but for work reason we want to ban speakers on rooted tablets (Android 5.0), I searched for the APIs &amp; system files, but couldn't stop it.

Any solution?
TL;DR Set device to silent. Tape it over.  

If you're able to open the case, you can easily find the speaker attached to the back (or somewhere near the bottom) where gold contact pins are visible. Tape over the pins and the speaker will stop working totally without getting damaged.
If it's not possible for you to open the case, then set your device to silent mode is your primary option. Taping over the speaker hole helps this to some extent, but not as effective as turning off sound. Because sound is a kind of mechanic vibration, it propagates via (almost) all kinds of media, including solid, liquid and gas (air) so you can't simply block it.