Start learning with our library of video tutorials taught by experts. Get started
Viewers: in countries Watching now:
To create our audio files, we are going to use a program called VLC. VLC is a free media player that can play just about any type of file and we can also use it for encoding our audio files. First you will need to download and install VLC, which you can find at http://www.videolan.org/vlc. All right, when we open VLC we are presented with the media player and the first thing we need to do is open the file that we want to encode. So I am going to open our audio source which is in our _audio assets folder and it's our podcast-audio.mov.
(Music playing) And you can see it starts playing that as if we want to listen to it, but we don't right now. What we want to do is to go under the File menu and select the Streaming/Exporting Wizard. We will open that up and now we are basically taking through a step by step process to create the files that we want. The first step is to select Transcode/ Save to file and click Next and then select in our Existing playlist, we find our podcast-audio movie. So we will choose the first one in the list and then check the audio checkbox for Transcode audio and the first source we are going to do is actually the MP3 source, so we will go ahead and leave it set to MP3 and 192 is actually a good bit rate for web video playback.
So we will leave that at 192. All right, then we will click Next. Now the output format, it says here the Encapsulation format. It's also the container format that we talked about before and for the MP3 we are going to select the RAW container format, because remember I said that the MP3 format is the one that doesn't actually have a container format. So we use the RAW format here then click Next. Then we are going to choose a folder to put it in, so we are going to use the encoded folder inside of our _audio assets folder,just like we did with video, and save it there and I am going to call it podcast-audio.mp3.
Now it's going to yell at us and says it doesn't want to use the mp3 extension for the RAW format. So for now we will just say use .raw, then actually in this save file dialog box we can change it from .raw to .mp3 and it will keep that for us. So let me click Next and it gives us a summary of all the settings, which all look right so I am going to click Finish. It's going to look like it's playing it, but what it's actually doing is encoding the file and now it's done. And if we go over to our folder and look in our _audio encoded folder, I am going to see we now have our podcast-audio.mp3 file there. Great! That worked.
Let's go and create our other two versions which we can do both in VLC. We will go back up to our Streaming/ Exporting Wizard. Transcode/Save to file, Next, and the same source file, click Next, and we have Transcode audio, and for this one we need to do MPEG 4 audio and this is going to be our aac format. Let's click MPEG 4 audio and keep the Bitrate at 192 and then click Next, and then for our Encapsulation or container format we are going to select the MPEG 4/MP4 format and we will choose the location, and it already has the location of our last one so actually I can just go over here and change the extension to what we want it to be and that's m4a.
That is our podcast audio m4a. All right then we can click Next. It gives us a summary again. And click Finish and it's encoding it and we can see it has already created in that folder. All right! One more time let's do this for our OGG format. So Files > Exporting Wizard, Transcode, select the source, and now for the Codec we want to select Vorbis. Vorbis is our audio codec for OGG Vorbis format and we can keep it at 192 bit rate and click Next and we will have one option for the container format, OGG.
So that's easy and then we can change the extension and our output name and that will be .oga and click Next. Get a summary and click Finish and it's creating that format. You can see it's already created it and it's building it in our folder. Now we have our three versions. Let's go ahead and plug those into our code. Go back to our text editor and scroll down to our audio tag. We can plug in the two versions that we need and they are now in the encoded folder.
I will do that for both sources and save that and so now the m4a version should play in Safari, while the OGG version should play in Firefox. So let's open up Safari first and reload the page and scroll down to our audio and play that. (Music playing) All right! And we can see that worked. So let's go over and make sure it worked in Firefox. I am going to open up our Podcast page, reload.
(Music playing) All right. It shifted down there because of the Firefox issue that kind of puts space above the audio player, but the audio file worked and so those two versions worked. Let's go ahead and try the mp3 version just to make sure that worked in case that's the version you want to use. So I am going to replace the m4a with mp3 and open Safari again, reload and play that. (Music playing) So that's working as well. Okay, so all the audio formats work and with that now we know how to create all the audio and video files we need for HTML5.
There are currently no FAQs about HTML5: Video and Audio in Depth.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.