On Apple platforms, there is a difference between directly playing audio in Safari and playing in an HTML5 audio tag. When directly playing in Safari, it uses the codec in the device, when playing in an HTML5 audio tag, it uses the codec only available for Safari.
So an m4a audio file may play if you directly open the m4a file URL with Safari, but may not play in an embedded HTML5 audio tag.
This tutorial will show you how to convert m4a audio files to HTML5 compatible m4a or mp3 format on Mac by using the Apple Music app.
There are 4 steps in this tutorial.
- Step 1 - Open the m4a file with the Apple Music app
- Step 2 - Change the import settings of the Music app
- Step 3 - Convert the m4a file
- Step 4 - Drag the file to the desktop
Step 1 - Open the m4a file with the Apple Music app
In the Finder app, right click the m4a file, open it with the Apple Music app. In the Music app, click Songs on the left menu list.
Step 2 - Change the import settings of the Music app
In the Apple Music app, click the top menu Music -> Preferences, go to the Files tab, click the button Import Settings.
In the Import Settings, if you want to convert the file to an HTML5 compatible m4a format, select the AAC Encoder, then select High Quality (128kb/s).
If you want to convert the file to an mp3 format, select the MP3 Encoder option.
Step 3 - Convert the m4a file
In the Songs list, click and select the m4a file, then go to the top menu File -> Convert -> Create AAC Version.
If you have selected the "MP3 Encoder" in the Import Settings, go to the top menu File -> Convert -> Create MP3 Version.
Step 4 - Drag the file to the desktop
After the conversion is completed, drag the new file from the Songs list to the desktop.