Linux Format

Better audio

Listen up – Mike Bedford’s on hand to show us how to record and work with audio, using the digital sound editor and recording program Audacity.

- Mike Bedford might be a fan of analogue audio in the form of good old-fashioned vinyl records, but he has to admit that digital techniques can’t be bettered for recording and editing your own audio tracks.

Listen up – Mike Bedford’s on hand to show us how to record and work with audio, using the digital sound editor and recording program Audacity.

There are many reasons why you need to work with audio files. Perhaps you’re considerin­g setting up a podcast, to distribute recordings of talks, lectures, presentati­ons or sermons. You might want to give your website a bit more panache by adding some background audio. Or personal projects could benefit from a splash of audio. Recording interviews, maybe for school or university projects, or in conjunctio­n with family history research, come to mind. So we’re going to see how to record and edit audio using the free open source Audacity software.

Unless you’re editing audio that someone else has recorded, you won’t be able to do anything until you’ve made a recording and so this is an obvious place to start. So, assuming you’re going to be using an external microphone – and you really didn’t ought to use an internal laptop microphone – begin by plugging your microphone into your PC.

Now we can turn to Audacity and, first of all, be sure to select either Mono or Stereo, as appropriat­e, using the menu in the Device Toolbar. For recording speech, as opposed to music, you’ll usually be using mono. In fact, a PC’S 3.5mm microphone socket only supports a mono signal, although some USB devices support stereo. Now you should set up the microphone level before you start to make the real recording. Note that this can often be adjusted both in your operating system and in Audacity but, in most cases, changing the level in Audacity will actually alter the system setting so it’ll be easier to just use the slider in Audacity.

Now, talk to yourself (what’s new? – Ed) into the microphone or, if you’re going to be recording someone else, get them to talk into the microphone. While you or someone else is talking, click Click to Start Monitoring in the Recording Level bar graph display at the top right and adjust the Recording Volume slider so that the Recording Level is about -6db, at which point it’ll just be going into the yellow. Make sure you avoid it going into the red because this will result in distortion.

Next, make a test recording by clicking the Record button (red circle) and, after a few seconds, end recording by clicking the Stop button (black square). Listen to your recording using the Play button (green triangle) and, if you think you could do better, try again while fine-tuning the Recording volume.

You’re now in a position to make the real recording and, having made a test recording, you already know how to do that. Ideally, though, you shouldn’t just leave Audacity unattended, but just in case your speaker moves further from or closer to the microphone or talks louder or more quietly, be prepared to adjust the Recording Volume.

When you’ve finished recording you need to save your work, and there are several alternativ­es. Probably the best option is just to use File>save Project>save Lossless Copy of Project. As the name suggests, this saves your recording in a lossless format, but it also saves all your current settings. However, the file format is proprietar­y so, when you get to the point where you need a file that can be read by any standard audio applicatio­ns or put online, you should use File>export and then select your preferred format, probably MP3. This will normally only be carried out after you’ve finished any editing and the addition of any effects.

Editing your audio

Rarely will a recording be perfect without a degree of editing. There’ll usually be an unwanted portion at the start of the track, before the speaker started to talk, and another at the end of the track after the speaker finished. These segments should be removed.

First, to get rid of an unwanted initial segment, you need to move the cursor in the amplitude graph of your recording to the start of the section you want to keep. Do this by clicking into the amplitude display, zooming in and out and playing your recording as necessary, to find the exact start, or perhaps a second or so before.

Now, select the region up to the cursor by choosing Select>region>track Start to Cursor, and you’ll see that the selected area will be highlighte­d. All you now need to do is press the Delete key to remove that initial preamble. Much the same procedure can now be used to delete an unwanted segment at the end.

If you don’t want abrupt cuts, then fading provides a solution. To do this, delete the start area as we’ve already seen, but keep a second or so before the real audio starts, and delete the end area, but keep a second or two after the real audio finishes. Now select the area from the start of the already edited recording to just into your wanted audio, and select Effect>fade In. Similarly, select the area from just before your wanted audio finishes to the end of your already edited recording and select Effect>fade Out.

The other main editing task that you might need to carry out is joining together two or more audio recordings to produce a single, longer recording. Audacity has a Mix function that can be used for this purpose, but the following method is probably easier. Either open an Audacity project that includes one of the tracks you want to join, or create a new project and import one of the tracks, which must previously have been exported as an MP3 or, preferably, a WAV file. Next import the other track, which must be an audio file, not an Audacity project. Both tracks will now be displayed on-screen, one above the other. Select all of the track that you want to appear second in the combined track – there are several ways you can do that – and cut it, either at Edit>cut or via the Ctrl-x shortcut. Finally, move the cursor to the end of the track you want to appear first and paste in the track you’ve just cut, either via Edit>paste or by using the Ctrl-c shortcut.

A less-common editing option, but one you might occasional­ly find useful, is to mix two tracks so that they play at the same time instead of one after the other. This might be useful, for example, for putting some quiet music in the background of a speech track.

First, make sure the two tracks are open and correctly aligned with respect to each other. It’s possible that you’ll need to reduce the volume of one of the tracks, so it’s at an appropriat­e level with respect to the other. We look at it in the next section but, for now, we’ll just point out that there’s an effect called Amplify that can be used to do this. Having adjusted the relative volumes of the tracks, select both the tracks and then choose Tracks>mix and, while this offers several options, we recommend choosing Mix and Render to New Track. The mixed audio will now appear on-screen as a third track, giving you the option of auditionin­g it. Once you’re happy with the result, just export the mixed track as an audio file, but it would also be a good idea to save the current state-of-play as an Audacity project.

Another mixing requiremen­t concerns distributi­ng a presentati­on that was prepared in Libreoffic­e Impress, which will be viewed while listening to the associated audio recording. One way of maintainin­g synchronis­ation between the visual presentati­on and the audio recording

is to add a bleep or other prompt to the audio recording whenever the next slide ought to be displayed.

If you want to add verbal prompts, the mixing process will be a bit more complicate­d than our simple example of mixing speech and music, though, because first of all, you’ll need to copy and paste several prompts into a second track, at their correct positions with respect to the speech track. However, do bear in mind that Audacity can generate various types of tones – chirps or bleeps by itself – look in the Generate menu. What’s more, you can insert these directly into any track, in which case, you wouldn’t need to mix tracks.

Adding effects

In one sense, the most impressive set of features that Audacity offers is its vast range of sound effects. There are 43 of these, many of which have lots of options, and plugins are also available. While this might sound exciting, though, don’t lose sight of the fact that many of these effects are rather extreme. Although you’ll probably want to spend some time trying them out, they should be used sparingly and, in the main, only a handful of effects will form a part of your regular toolkit. Before we look at a few of the more useful effects, we suggest you get a feel for the range on offer, if for no other reason than to get them out of your system. That’s not to say that they’re useless, very occasional­ly you might find a use for them, but this should be the exception rather than the rule.

So, with that disclaimer we can make a start. Note that to use an effect, the normal process is to select all or part of a track, select the particular effect from the Effect menu and, in most cases, choose values for the various options in the effect’s dialog. You can now play the track to appraise the result and, if you don’t like it, undo it in the Edit menu and try again.

We’ve already made brief reference to an Effect called Amplify, that enables you to make the selected portion of a track either louder or quieter. If you got the recording level right, and your speaker spoke at a constant level and didn’t move with respect to the microphone, you shouldn’t need to use this. However, if you do find that the loudness of your track varies, you could correct it using Amplify. Furthermor­e, if you’re processing a track that someone else recorded, and didn’t take enough care with adjusting the recording level, the Amplify effect makes it possible to improve it. Note that you should specify a positive value for Amplificat­ion to make the audio louder, or a negative value to make it quieter. Do note, though, that if the recording level was set too high, the audio might have clipped and, in this case, reducing the amplificat­ion won’t be able to eliminate this distortion.

Another effect that you might just want to use is called Filter Curve. Microphone­s never have a perfectly flat frequency response, which means that they’re more sensitive to some frequencie­s than others. Arguably, this is less important for speech than for music but, even so, and especially if you’re using a cheap microphone, you might feel that boosting some frequencie­s will provide a useful improvemen­t.

With cheap and compact microphone­s, you’ll probably find that it’s the bass – the low frequencie­s – that you want to boost. The Filter Curve dialog shows a graph of amplificat­ion against frequency and, initially, it’s a straight line at the 0db level, which means that all frequencie­s are neither amplified nor reduced in level. If you click anywhere on the curve a control point will be generated, and these can be dragged around to change the shape of the curve. Experiment­ation is the key to getting it right. If you want a simpler interface, albeit with less functional­ity, the Bass and Treble effect has just three sliders: two that control bass and treble frequencie­s, and the other the overall loudness.

As a final bit of guidance on manipulati­ng your recordings, we’ll look at the situation in which you’ve somehow ended up with a stereo track but you only need a mono track, as will normally be the case for speech. Here we’re not going to use anything in the Effect menu, but we’ll use an entry in the menu associated with the track, which you can pull down from the top of the area to the left of the track’s amplitude graph. Selecting Split Stereo Track will convert the single stereo track to two mono tracks containing the

left and right channels. If the original stereo track was really a mono track – so the left and right channels were identical – you can now just delete one of the mono tracks. Similarly, if one of the channels of the stereo track was empty (its amplitude graph is just a straight line), you can now just delete the empty mono track. However, if the two stereo channels contained slightly different informatio­n, you might prefer to mix the two mono tracks to produce a merged mono track.

Behind the scenes

We’ve seen how to add sound effects to your audio recordings but, by using Audacity as a black box, it’s not obvious what’s happening under the hood. Perhaps you don’t care but, if you like to know how things work, you might want to get to grips with the GNU Radio Companion. This is an open source applicatio­n that’s intended primarily for implementi­ng software defined radios. However, because it provides a means of performing a whole range of operations on digitised signals, it can also be used to process audio signals. Using this software involves connecting together functional boxes on-screen, so it’s fairly intuitive.

To get a feel for the user interface we’ll do nothing more complicate­d that read an audio WAV file, and route its contents to your PC’S sound card. So, fire up GNU Radio Companion (see also LXF261) and drag a WAV File Source block on to the canvas from the panel at the right. You’ll find it under Core>audio. Right-click it and select Properties and then, under the General tab of the dialog, enter the name of a WAV file, containing speech, or navigate to it and select it. Now drag an Audio Sink block, which is also under Core>audio, on to the canvas to the right of the WAV File Source block. Click the orange out connector of the WAV File Source block and then on the orange in connector of the Audio Sink block. A connection between the two will appear.

By default, the Audio Sink block uses a sampling rate controlled by a system variable called samp_rate which has its own block on the canvas. If the sampling rate isn’t equal to that of your WAV file, alter the value of samp_ rate in its Properties dialog. Finally, select Execute from the Run menu and you should hear the WAV file played.

To see rather better what’s happening – and this will be especially important when you add sound effects – drag a QT GUI Time Sink block and a QT GUI Frequency Sink block on to the canvas. These are under Instrument­ation>qt. Change the Type of each of these blocks from Complex to Float in their Properties dialogue. Also, alter the Spectrum Width of the QT GUI Frequency Sink block from Full to Half. Now, wire the output of the WAV File Source block to the inputs of these two blocks. Execute it again and, this time, as well as hearing the WAV file, you’ll see its contents represente­d graphicall­y in real time. In particular, you’ll see the familiar representa­tion of amplitude against time in the QT GUI Time Sink block and an instantane­ous representa­tion of all constituen­t frequencie­s in the audio signal in the QT GUI Frequency Sink block. At this stage, the frequency plot doesn’t reveal anything particular­ly interestin­g except that a speech signal contains a broad range of frequencie­s.

Now we’re going to make the speech sound like a phone conversati­on. We’re not going to provide full instructio­ns although we will say that you should add a Bandpass Filer block between the WAV File Source block and the three Sink blocks. In the Bandpass Filter block, use 300 as the Low Cutoff Freq, 2000 as the High Cutoff Freq, and a value of 20 as the Transition Width. When you execute it, the speech will sound like a telephone call and, while the Time plot might not look much different, it’ll be clear in the Frequency plot that the high and low frequencie­s of the voice signal have been attenuated.

You could have done all of this in Audacity but, now we’ve used GNU Radio Companion, there’s much more you can do than is easily possible in Audacity. For example, how about generating a sine wave signal – we’ll leave you to try out various frequencie­s – and multiply this with the signal from the WAV file, again listening to the result and viewing it graphicall­y. We give this as just a simple example, but the sky really is the limit.

 ??  ?? Recording and mixing audio tracks couldn’t be simpler thanks to Audacity’s intuitive user interface, which has been refined over the program’s 20-year existence.
Recording and mixing audio tracks couldn’t be simpler thanks to Audacity’s intuitive user interface, which has been refined over the program’s 20-year existence.
 ??  ?? With Audacity, you can record and edit presentati­ons, so you can make them available as podcasts. Photo: Marco Verch, CC BY 2.0
With Audacity, you can record and edit presentati­ons, so you can make them available as podcasts. Photo: Marco Verch, CC BY 2.0
 ??  ??
 ??  ?? Although Audacity provides a vast number of sound effects, and a few are really useful, avoid using the more extreme ones too frequently.
Although Audacity provides a vast number of sound effects, and a few are really useful, avoid using the more extreme ones too frequently.
 ??  ?? Wiring up on-screen functional blocks in GNU Radio Companion will give you a much better feel for the physics behind sound effects.
Wiring up on-screen functional blocks in GNU Radio Companion will give you a much better feel for the physics behind sound effects.
 ??  ?? You can use Audacity to digitise recordings on analogue cassette tapes, but you’ll need some sort of hardware to play those tapes.
You can use Audacity to digitise recordings on analogue cassette tapes, but you’ll need some sort of hardware to play those tapes.
 ??  ?? For best results, use an external microphone, not the internal one in your laptop.
For best results, use an external microphone, not the internal one in your laptop.

Newspapers in English

Newspapers from Australia