When connected to an HDMI projector or external display, the audio may continue to play only from the MacBook Pro internal speakers. OS X does support HDMI digital audio, however you have to specify output for it to work. This can be accomplished two ways:
In System Preferences, Click on the "Sound" preference pane. There is an "Output" tab. Under output, it will list all available connections. Select HDMI audio, to enable. That option will only show, provided that the HDMI cable is connected, and the display/projector is powered on.
There is a quicker way as well. Hold down the key marked "Option" on your keyboard, and click on the volume indicator in the menu bar. It will change from volume level, to sound control. You can select the output there as well.
After the first few times you do this, it will be second nature.