When presenting multimedia files using AirPlay to an Apple TV, or by connecting an HDMI cable with the appropriate Apple adapter, the audio and video are aggregated and routed together through the HDMI cable. The audio is controlled by the final output device, such as the volume controls on a television, or by connecting a wired speaker to the audio output on the projector. When connecting using an HDMI cable you cannot also connect to a Bluetooth wireless speaker, or use the headphone jack if your iPad model has one.
If you connect your iPad to a TV or projector using a VGA cable with the appropriate Apple adapter, you can connect to a Bluetooth wireless speaker, or use the headphone jack if your iPad model has one.
Please see this FAQ on the appropriate adapters to use: https://support.litsoftware.com/hc/en-us/articles/360051156913-What-adapters-should-I-use-to-connect-my-iPad-to-a-TV-or-projector-