Optimizing your audio files is important for improving performance of your website or application. Compression techniques used on audio files reduce the size of files, speed up download times and reduce the amount of bandwidth required.
This guide focuses on pure audio files. For information on addressing audio components of video files, see the Video optimization guide.
Some audio formats use more compression than others, and some use no compression at all. The quality of compressed audio may not be as perfect as the uncompressed equivalent, but for many purposes it is acceptable and the difference is not perceivable by most people.
You can change the format of an audio file that you've uploaded to Cloudinary by changing the delivery URL extension to one of the audio formats that is supported for delivery by Cloudinary.
Audio files are uploaded to Cloudinary as videoasset types.
For example, the asset in the demo account with public ID docs/fireflywav is a WAV file (not compressed). You can deliver it as an MP3 file (compressed) by using the .mp3 extension in the delivery URL:
The main audio formats supported by web browsers are AAC, OGG, WAV and MP3.
AAC, OGG and MP3 are compressed formats, so they download faster and use less bandwidth than WAV files. WAV files provide the highest quality, but depending on your application, the sound quality of ACC, OGG and MP3 are likely to be sufficient.
This table shows the file size of the fireflywav audio snippet when delivered in each of the different formats:
If you use the <audio> tag on your site, you can set the src in each of the <source> tags to different formats in your preferred order. The browser picks the first one that it supports. Therefore, to prioritize optimization over quality, design your <audio> tag as follows:
Copy to clipboard
Your browser does not support the audio element.