How can I record sound from YouTube videos?

Updated: 06/02/2020 by Computer Hope
YouTube

If you want to download or capture the audio of a YouTube video, you have a few options. You can use a third-party online service to download the audio and convert it to mp3, or capture the audio with software on your Windows or Mac computer.

Note

The steps below are for saving the audio portion of a video only. To download video, see: How do I download or save a YouTube video to my computer?

Use an online service

Below are steps on how to record sound in a YouTube video using an online YouTube to MP3 conversion service.

Tip

We have found the steps below to work best using the Chrome or Firefox browser. If you are using Microsoft Edge or Internet Explorer and have trouble downloading the MP3 file, try Chrome or Firefox instead.

  1. Go to the YouTube video page and copy the URL of the video you want to save as an MP3 audio file.
  2. Once the URL is copied, access the YouTubetoMP3 Converter site.
Note

The YouTubetoMP3 Converter service is free to use. The site may display ads to pay for their service, but you are not required to pay any money to use it.

  1. Paste the copied YouTube video URL into the text box near the top of the page.
  2. Click the red Go button next to the text box.
  3. A preview of the YouTube video is displayed. To the right of the preview, click the drop-down menu and select the MP3 quality you want to set for the conversion.

YouTubetoMP3 Converter - MP3 quality selection

  1. Click the red Convert button to begin the YouTube video to MP3 audio conversion.
  2. When the conversion is complete, click the Download button below the MP3 quality drop-down menu.

YouTubetoMP3 Converter - download MP3 file

Capture audio with Audacity

Audacity

If you want to manually record the audio, or only need a segment of the video's sound, you can use the free software Audacity to capture the audio. To proceed, follow the steps below.

Note

If your computer has an integrated sound card, you'll not be able to download streaming audio. Therefore, the steps in this section will not work for you. It's best to use an online service, as discussed above, to download audio from a YouTube video.

  1. Download Audacity from the Audacity official website.
  2. Once the download is complete, run the setup program and follow the steps to install Audacity on your computer.
  3. Open Audacity using the shortcut on your desktop, or run it from your Start menu.
  4. In the menu bar at the top of the Audacity window, click Edit, then Preferences.
  5. In the Preferences window, in the Devices section, locate the Recording section.
  6. In the Device drop-down list, select the Stereo Mix option. If Stereo Mix is not available, it is likely disabled. To enable it:
  1. Open the Control Panel on your computer and click Hardware and sound, then the Sound icon in the Control Panel window.
  2. In the Sound window, click the Recording tab, right-click in a blank space in that tab, and select Show Disabled Devices from the drop-down menu.
  3. The Stereo Mix device should now be visible. Right-click that device and select Enable.
Note

If the Stereo Mix option is still not available, it is likely because your computer has an integrated sound card. Stereo Mix is not available with many integrated sound cards and you cannot download streaming audio from a YouTube video. We recommended trying the online service or YouTube-dl solution instead.

  1. Click OK to save the sound settings change.
  2. If Audacity was open when you enabled Stereo Mix, close and re-open the program. Stereo Mix should now be available in the Recording Device list.
Tip

You can select the settings in steps four and five in the main Audacity program window as well. There are four drop-down lists located above the middle of the program window. The second drop-down list from the left is for the Recording Device (next to microphone icon). Select Stereo Mix in this drop-down list.

Audacity Recording Device setting

  1. While still in Preferences, select 2 (Stereo) in the Channels drop-down list to enable stereo sound.
  2. Click OK when you are satisfied with your settings.
  3. Access the YouTube video you want to record. Unless you have a fast connection, we suggest getting the video fully loaded (allow it to complete the buffering process) before recording.
  4. Once your video is loaded on the YouTube website, click the record button (red circle) in Audacity, then switch back to the YouTube video and click play. As the video is playing, you'll see action in the sound wave section in Audacity. When done recording, click the stop button (black square to the left of the record button) in Audacity.
Tip

Doing it this way causes a section at the beginning of the sound file to be blank. To remove this section of blank audio, highlight it by clicking and dragging your mouse, and then press the delete key on the keyboard. You can also enable the Sound-based Recording option in Audacity to eliminate the blank section of audio.

  1. When you have completed your recording, click File, select Export, then select Export as MP3. Make sure MP3 Files in selected in the Save as type drop-down list. Choose a location to save the MP3 file, enter a file name, and click Save.
Note

For older versions of Audacity, you may need to install LAME MP3 file support to save the recorded audio as an MP3 file. See the section below for additional information.

Getting MP3 support for Audacity

  1. To save the file in MP3 format, you need to get LAME for Audacity from the LAME download site. LAME is available for both the Windows and macOS.
  2. Once downloaded, install LAME on the computer.
  3. When you have completed your recording, click File and choose Export. Select MP3 Files in the Save as type drop-down list. Enter a File name and click Save.
  4. After selecting the MP3 Files type, you may be prompted for the location of the LAME file. Point to the lame_enc.dll file, located at C:\Program Files\Lame for Audacity if you used the default install location. If you extracted from a compressed file, it's in the extracted folder.

Download audio with YouTube-dl

Youtube-dl and FFmpeg commands

If you use the Windows command line, you can download the audio component of a YouTube video with YouTube-dl, a free, open-source program that downloads streaming audio and video.

For example, you can download the audio in m4a format with the command:

youtube-dl -f 140 url

Where url is a web address in the form: https://www.youtube.com/watch?v=ID.

Convert to mp3 with FFmpeg

To convert the m4a file to an mp3 file, you can use the open-source program FFmpeg. For example, this command:

ffmpeg -i "Input file.m4a" "Output file.mp3"

Would convert the file named Input file.m4a to a new mp3 file called Output file.mp3. In the command above, the file names are enclosed in double-quotes because they contain spaces.

Running these commands looks similar to the following picture. In this screenshot, we use the dir command to verify the mp3 file was created.

YouTube-dl and ffmpeg

For more information, see Downloading audio with YouTube-dl.