Here is a guide to converting audio from YouTube, and then splitting a single audio file via Audacity.
[In conjunction with the parent article: Linux Audio Tools.]
Like many, YouTube is a captivating platform for video die-hards. You can also view/listen to full-length music albums, most of which are older vinyl LP’s which have never seen an official CD release.
If like me, you like listening to some of those dinosaur recordings away from YouTube, you can use tools to both convert a video file to audio, and then split the audio file into smaller separate files. This is how I do it.
YouTube Audio Converter
There are several online services which can convert a YouTube URL string, to a local mp3 file. You really want one that can convert at 192kbps or higher. The one I use is http://theyoump3.com, which converts to 192 by default. Another one I’m aware of is: http: //convert2mp3.net. There are probably several others. Use this research and discernment when using any of these.
The function is very straight forward.
Find the YouTube URL string of your choice. In this documented example, you need a video/URL which is labelled as FULL ALBUM, with several songs in the video. It doesn’t matter which one you use for your test, just find one, and copy out the URL to a text file. Strip out anything after the v= part, like List references. The final URL should look like this:
- Go to the http://theyoump3.com website, enter the above URL into the ‘Insert The Video Link Here‘ field, and then click the Convert button.
- Once the conversion is complete, it will land on your computer. If not to a default folder, then to the folder of your choice.
- This file can then by opened by Audacity, which we can now move onto part two of this examples/test.
Make sure you have Audacity installed on your Linux system. Some distros have it installed by default, others you will have to manually install through the command line:
sudo apt-get install audacity
- Once Audacity is installed, you can access from the menu: Menu > Sound & Video > Audacity.
- Open the converted mp3 download file, wait for it to open, it could upward of 30 seconds or so, considering it is a full-album file.
- You should now see the file opened, it will be shown as a blue coloured waveform.
Inspect the waveform. You will see clear spaces (or gaps) across the file. These are the breaks in between songs. It is these breaks where we have to insert labels (or markers). These label placeholders act as break-points, so when the automated separation process occurs, the files will be broken at those intersections.
To do this, we create labels on each blank space. Having done this a few times already, I reckon it is easier to start from the last song/file, and then work your way forward.
Go to the last track. Place the playhead on the region where the space is (between the penultimate track and the last track). The playhead should just be a single line, rather than an extended space.
- From the top menu go to: Tracks > Add Label At Selection. A small box will appear on the break point, underneath the waveform.
- Enter some text. Because it refers to a song, enter that as the text, for example: ‘05 – Track 05‘.
- When the wave-form is separated, the labels become your file names. If you save the labels as file names at this stage, it will save you a renaming job later on.
- Go to all the other break-points, and add a label until the entire wave-form is completed. For track 01, click the rewind button until the playhead reaches 00:00, then add the label ’01 ……’
Now that all the labels are added, it is time to begin the separation process. From the top menu go to: File > Export Multiple.
- Select where the exported/separated files are to go [select a folder]
- Select your format. There are many options here. I just used mp3, export at constant bit rate, at 192 kbps. You however, can select whatever you require.
- Select your Name Files option. This refers to the labels you have given. The default is: ‘Using Label/Track Name’. If you haven’t included a track number in your label, then you should use: ‘Numbering before Label/Track Name’. Because I have included a track number already, I can just leave it at the default setting.
- Click Export.
- The Edit Metadata dialog will display. We will not edit anything in this section, we will do that later using the EasyTag application. Click OK through all the songs.
- Once done, the actual export/separation will begin, and build the separated songs as files in your selected folder.
- If you wish to save this wave-form file (with the added labels) as an Audacity Project, go to: File > Save (save as an AUP file).
Here is a YouTube video example of how to split out a single audio file via Audacity. Even though the Audacity version used in the video is based on Windows, the same principles apply in Linux.