Next time it does this, count the number of beeps.
The amount and/or frequency of the beeps tells you what hardware might have failed. It is not a virus.
My recommendation is take it to your nearest Apple store wether or not your computer is in warranty. If it is out of warranty, the vast majority of hardware repairs are covered under a flat fee.