For the best cross-browser consistency, include .mp3 and .ogg resources of audio elements in your project. For a detailed description of supported audio types, visit Media formats supported by the HTML audio and video elements.
To create fallback versions of your audio file, you can use an audio conversion application such as Adobe Audition, which is included in your Creative Cloud membership.
Add audio to compositions
Do one of the following:
- Drag-and-drop the audio files into your project from your file system. An 'audio group' with the name of the audio file is created in the Library. This audio group contains the audio file and the fallback files for cross-browser compatibility.
Note: Fallback files get automatically grouped under the audio group when you drop them into the project.
Audio group in Library
- Click Add Audio in your project Library and browse for the audio file. Then, drag the audio group to the stage.
Add Audio option in Library
After you add audio to your project, an 'audio element' appears in the Elements panel. When you select the audio element in the Elements panel, options to control the playback of your audio appear.
Audio in Elements panel
Play back and control audio
You can play back and control audio using any of the following options:
- Properties panel
- AutoPlay: Allows the audio file to automatically play on the timeline.
- Loop: Makes the audio file loop from the beginning after it finishes playing.
Audio control options in the Properties panel
- Play: Plays the audio file from the current playhead position.
- Play From: Allows you to specify the time marker you want to play from.
- Pause: Allows you to pause the audio track. Use a play function to resume play back.
Audio control options in Timeline
Important: Sometimes your audio plays perfectly fine locally, but fails to play after you load it to your Web server. In such cases, configure the .htaccess file of your Website to include the MIME types required for audio support. Contact your Website administrator for assistance.
You can set keyframe transitions to control volume transitions in the timeline. Use volume transitions to create unique audio effects, such as, fade in, fade out, and cross-fading multiple tracks.
Volume transitions for audio are not available on most mobile devices. See Using audio on devices for restrictions.
To preload audio files before the composition loads, select “Preload Audio” in the Preloading section of the Properties panel on stage.
Note: Preloading audio is not available on most mobile devices. See Using audio on devices for restrictions.
Enable the default audio player
You can use the browser default Windows Media Player to show controls for your audio. The default audio player is hidden by default. To turn the display of the player on, select the audio element and select “On” in the Properties panel.
Enabling the default audio player
The player skin is rendered by the browsers, and appears different based on the browser it is viewed in. For example, the player you see in Chrome is different than the player you see in Firefox. See Audio actions to learn how to create custom controls that you can use to create your own player.
When the player is viewed on stage, you can add motion and transform properties to the player like you add for other objects. Since <audio> elements are a special type of HTML element, only a subset of properties is available for you to apply:
- Position and Size
Using audio on devices
In Safari on iOS (for all devices, including iPad), where users may be on a cellular network and be charged per data unit, preload, AutoPlay, and play back actions are disabled. No data is loaded until the user plays the audio.
You can use the Audio Actions to call an audio element triggered by a user event. For more information on audio actions, see Audio Actions.
Volume keyframes and control configured through the volume property are not supported on iOS devices. Users can adjust the volume using the volume control of the device itself.
Prior to iOS 4.0, iPhone and iPod touch did not play audio inline. Audio was presented in full-screen mode. Audio plays inline on iOS 4.0 and later on all devices.
Tips and cross-browser considerations
Audio can be used to choreograph sound to your stage compositions. However, due to the nature of the Web, audio tracks can fall out-of-sync with elements moving on the stage. You may experience playback latency when coordinating movement with sound, especially in longer tracks.
Using audio sprites allows you to create a single audio file with separate playable parts. This technique is used to download all your audio in a single file to save download time.