There are times where you have a video and would like the sound portion to use in your electronics project. The video can be from your own recordings or from videos on the Internet such as Youtube.
The process for extracting audio from video will be shown for a number of sources. Expect the complexity of this to be greater than just converting audio, as it helps to have some experience with video editing.
If you have a video file, in whatever format you recorded it in, you can convert the file to an audio-only version which can be feed into another program to encode it to the parameters needed for your electronics project.
If the video is on the Internet, like Youtube, first follow this guide to get a video file of that content.
There are several programs that can convert video files to audio-only formats. There are also websites that purport to do this although there may be ads or malicious content on such websites.
First, we will demonstrate the open source available video and audio player VLC. VLC is available for every computer operating system (Mac, PC, Linux) and also for portable devices (Android and Apple iOS).
You can also use Quicktime, that will also be shown below.
Go to the Audacity web site and follow the instructions to install and configure.
Open VLC and click the menu bar (upper left) on Media then Convert / Save...
This will pop up a window named Open Media. This is the correct window. You can capture from multiple sources - here I demonstrate with a file by clicking the + Add button and selecting a video file I have on my hard drive.
Click the Convert / Save button at the bottom and a new screen pops up:
Select "Convert" button, in Profile Select Audio CD then the wrench icon (the first one, spanner for UK). This will pull up another pop up screen to adjust the settings:
Click the Audio codec tab. Change the values to:
- Audio box checked
- Codec: WAV
- Bitrate: you can leave this or lower it to save space but no lower than 44 kb/s
- Channels: 1 (which is mono which we want)
- Sample Rate: 22050 Hz
Click the Save button
You're back at the Convert screen. Add the Destination file name (you can click Browse to find a directory to save the file in if you want). Be sure the file ends in .wav and not another extension name. Click the Start Button to convert.
Let the computer process the file, in general wait the length of the audio clip but for a fast computer it may go quickly.
Audacity can also be used to trim an audio clip down to a manageable length, say part of a song or a specific word or sound effect.
Quicktime can take a video file and export just the audio from the video. See the screenshot below: