Yes it is 
'The National Anthem statute now on the books, known as 36 U.S. Code § 301, acknowledges that the Star-Spangled Banner is the official national anthem; and that military members should salute as it plays or is performed, while “all other persons present should face the flag and stand at attention with their right hand over the heart, and men not in uniform, if applicable, should remove their headdress with their right hand and hold it at the left shoulder, the hand being over the heart.” In all cases, the attention given to the anthem should be the same, regardless of the presence of the flag at the location.'