Clive's FAQ About Audio on a PC

Page last updated: 19th January 2003

This page is a response to the fact that I tend to get a lot of emails asking for advice on a variety of issues related to audio on a PC. If you are thinking of emailing me with a question, please check first to see if it's answered here.

Before we start, here is a list of subjects that I often get asked about, but of which I have little or no knowledge:


Contents


How do I connect my stereo to the PC?

This section discusses (and tries to describe) various types of connectors and other devices. If you are unsure what the connectors are, here are some pictures (please note that where a scale is shown, it is a ruler marked in centimetres and millimetres):
You need a soundcard in your PC which is capable of recording in CD format (which is 44.1kHz, 16 bit, stereo). All modern soundcards are capable of this. This section will assume that you're using a mainstream soundcard (such as one of the Soundblaster or Turtle Beach range) that has stereo minijack connectors. (A stereo minijack socket is the same as the headphone socket on a personal stereo). If you have a more sophisticated soundcard with phono, 1/4" jack, or XLR sockets, you should already know know what you're doing.

To make decent quality recordings, you must use the soundcard's line input; the microphone input is generally of much poorer quality, and is mono on many soundcards. Here is how to identify the line input:

On the back of most soundcards, you'll see three minijack sockets. (Most soundcards also have additional multi-pin sockets which are used for things like MIDI, but we can ignore these). These three minijacks are the microphone input, line input, and line output. The sockets are colour-coded on some soundcards, and generally the colours used are:

However, this is by no means certain. Quite often there is a small picture next to each socket, either printed or engraved. One of these pictures is supposed to look like a microphone, but I think often looks more like an ice-cream cone; this is the microphone input. The other two pictures have a set of concentric circles; the one with an arrow pointing towards the centre of the circles is the line input, and the one where the arrow points out from the centre is the line output.

Having identified the line input, you need to feed it with an audio signal with the appropriate electrical characteristics. This signal is called line level, and is the signal level used by nearly all consumer audio equipment. Whether you're using a tape deck, radio tuner, VCR, CD player, DVD player, satellite TV decoder, etc, all these devices output a signal at line level. This means that you can connect the output of such a device directly to the line input of a soundcard.

The execptions to the above are the following devices:

You are very strongly advised to use the tape record output from your receiver to feed the soundcard. If you have an integrated stereo system which has no tape record output sockets, then you will probably have to use the headphone output. Some integrated systems have a pair of sockets marked "aux" or "auxilliary". These are almost certainly inputs, not outputs, so they will not be suitable.

Having identified the output from your stereo that you wish to use, there is now the problem of how to physically connect it to the soundcard. The soundcard's line input will be a stereo minijack (ie. like a personal stereo's headphone socket). Meanwhile, if you're using the tape record outputs from an amplifier they are likely to be a pair a "phono sockets". A phono socket is about 6mm (1/4") in diameter, with a small single central hole. The plug that fits this has a central pin with an outer ring. You'll need to get a cable with a pair of phono plugs at one end and a stereo minijack plug at the other. Most HiFi stores sell cables like this; they are primarily designed to connect a personal stereo into a component HiFi system. The fact that you'll be using it for recording rather than playback is immaterial.

There are two other types of output sockets you might be faced with:

Once you've got the stereo connected to the soundcard, you'll now need to make sure that your PC is ready to record from the correct input (ie. the line input). Most PCs are set up by default to record from the microphone input, and if you go ahead and try to record something without changing this, it's likely that all you'll end up with is a recording of the background noise of the microphone input circuitry.

See here for a description of how to set up the soundcard so it records from the line input.


How do I record from cassette tape to hard disk?

  1. Connect the output of the cassette deck to the line input (NOT the mic input) of the soundcard.
    You will probably need a cable with two phono plugs on one end and a stereo mini-jack on the other. Phono plugs (also known as RCA plugs or Cinch plugs) have a thin centre pin and a surrounding ring about 1/4" (6mm) diameter. Stereo mini-jacks look like the plug on a pair of headphones used with a Walkman. Most audio stores sell cables like this; they are primarily designed to connect the output of a Walkman into a home stereo system.

  2. Bring up the Windows Volume Control utility, select the Recording screen, and make sure the line input is selected. For a more detailed discussion of the Volume Control utility, see here.

  3. Use a suitable hard disk recording package (such as CoolEdit, GoldWave, etc) to record. Use the slider on the Volume Control utility's Recording screen to adjust the record level. Some hard disk recording packages may have their own record level slider, in which case it might be more convenient to use that.
    If you intend to write the results to a CDR, use WAV format, 16bit, stereo, 44.1kHz. Some recording packages describe this as "CD Quality".


I can play through the computer speakers, but can't record to hard disk

There is a difference between which inputs are made available to the soundcard's output, and which one is made available for recording.

Open up the Windows Volume Control utility. (This is usually available by double-clicking the little yellow icon of a loudspeaker in the system tray. If it's not there, go via Start|Programs|Accessories|Multimedia, or perhaps Start|Progams|Accessories|Entertainment). A screen titled "Volume Control" appears. On this screen you will see a selection of inputs. Each one can be individually switched on or off using its "mute" checkbox. All those which are not muted are available for playback through the soundcard's output, and their relative volumes can be controlled using the appropriate sliders. Thus, this screen behaves like a simple mixer, allowing multiple sources to be gathered together for output.

OK, all this is fine, and allows you to pass the input through to the output, but: it doesn't make the unmuted inputs available for recording to hard disk. To do this, select the "Properties" item from the "Options" menu. A screen titled "Properties" will appear. In the box titled "Adjust volume for", there are radio buttons: select the one for Recording. A list of available inputs appears in the box beneath "Show the following volume controls", and you should ensure that all the various inputs you may wish to record are checked in that list. Now press "OK", and the main screen's title changes to "Recording Control". This screen presents the inputs available for recording, and to activate the one you want, check its associated "Select" checkbox. The recording level can be adjusted using the selected input's volume slider; note that you can adjust this while recording (just like you can with the level control on a tape deck). You may also see a simple level meter (like the LEDs on a cassette deck) next to some inputs on some soundcards; whether they appear depends on the particular facilities provided by the soundcard's driver. However, this meter is uncalibrated and most hard disk recording packages are likely to have better metering. Once you have set the required record level, you can close down the Volume Control utility and the settings will remain unchanged.

One further tip. If you're recording anything other than the microphone input, it is a good idea to mute the microphone on the "Volume Control" screen whilst recording, as the microphone input circuitry can add a fair bit of noise on many soundcards.


I'm getting dropouts during recording to hard disk

There are a host of possible reasons for anomolies during recording. Most of them are system configuration issues, and they are discussed here in the order that you should investigate them, not necessarily because the earlier ones are more likely to be the cause, but because they are easier to check and/or correct. Remember that after making any Windows system configuration changes it is necessary to reboot the PC before they take effect.

  1. Compressed Hard Disks.

    There is nothing that can be said about this except: don't try to use compressed hard disk partitions for digital audio.

  2. Rogue Video Card Behaviour.

    Some video cards, especially those which perform Windows acceleration, obtain a small performance boost by not bothering to check if the bus is free before attempting to use it. The result of this is that, if the bus isn't free, then the video card tries to use it and blocks the bus, resulting in audio samples getting lost.

    A temporary solution might result from turning down the level of graphics acceleration (in Win95/98, via My Computer | Properties | Performance | Graphics).

    The proper solution is to contact the video card manufacturer and find out whether there is a way to configure its driver so that it always checks that the bus is free before using it.

  3. FindFast and Other Background Tasks.

    Programs lurking in the background which might spring into life at inappropriate moments are to be avoided. Things such as screen savers, email servers and the like should be switched off. One particular program of this type is FindFast; if you have installed a recent version of Microsoft Office it is probably on your system. The problem with FindFast is that you never really know it's there unless you take the trouble to check what tasks are running. If you discover that it is running, kill it, and also remove it from the Programs Menu Startup group (where it is likely to have placed itself).

  4. File System Read-Ahead.

    By default the Windows file system reads ahead, on the assumption that the running program is soon likely to want the data that follows. This is all very well for a typical PC performing a general mixture of "normal" computer activity. It is, however, the last thing you need while you're recording audio. Try reducing the amount of file system read-ahead (via My Computer | Properties | Performance | File System).

  5. Recording Software Buffering.

    If your recording software has facilities to adjust the buffering it uses then it is worth experimenting with that. Some packages have a default buffering strategy that is quite miserly. It costs nothing to increase but a little memory, and most modern systems have plenty to spare.

  6. 32-bit Disk Drivers.

    I know of one person who had a problem with a continuous "ticking" type of dropout during recording. He cured it by disabling 32-bit protected mode disk drivers. You can do this via My Computer | Properties | Performance | File System | Troubleshooting.

  7. System vcache Settings.

    The Windows virtual cache is quite often the culprit when occasional (rather than constant) dropouts are experienced. That said, it is probably better to eliminate other possibilities first, since to adjust the vcache requires that you edit the SYSTEM.INI file rather than just adjust some settings.

    If the vcache is allowed to change in size, it'll be just your luck that it does so in the middle of an important recording, with a consequent loss of samples. The trick is to set the vcache up with the same settings for its minimum and maximum size, thereby stopping Windows ever resizing it. To do this, you need to edit the file SYSTEM.INI in the Windows system directory (usually C:\WINDOWS). Open the file with any text editor (eg. Notepad) and find the section headed [vcache]. Add two lines beneath, so that the section looks like this:

        [vcache]
        MinFileCache=4096
        MaxFileCache=4096
    
    If there is no [vcache] section, add one at the bottom of the file. If the existing [vcache] section already has settings for MinFileCache and MaxFileCache, adjust them accordingly. The actual value to use (4096 in the example above) is the size in kilobytes of the cache. 4096 (ie. 4MB) is appropriate for a PC with about 32MB of main RAM. Generally about 1/8th of the main RAM is a suitable amount to use, but if you have more than 64MB of main RAM, it probably isn't worth setting your vcache above 8192.

  8. IRQ Conflicts.

    If your soundcard attempts to use the same IRQ as another device, anything can happen. If all your devices are plug-and-play, it is easy to check that there are no conflicts by going through each device under My Computer | Properties | Device Manager. If you have any non-plug-and-play cards, they must be set up manually to avoid conflicts. Moreover, you must also instruct the BIOS to prevent allowing the IRQs used by those non-plug-and-play cards to be assigned to plug-and-play cards. To do this, it is necessary to enter the BIOS setup during PC bootup, find the place where IRQ assignments are made, and set those IRQs being used by non-plug-and-play cards to the appropriate value (often called something like "ISA", or "N/A", or "Legacy").

  9. Soundcard Drivers.

    Although unlikely, it is possible that the drivers for your soundcard have some kind of incompatibility with the timing of your main system board. Modern PCs are less likely to have this problem; it was more an issue with old ISA bus 386 and 486 machines. Nevertheless, you should make sure you have the latest drivers for your soundcard.

  10. Disk Fragmentation.

    In these days of Ultra-ATA and SCSI hard disks, fragmentation is rarely an issue. Modern hard disks are so fast that the data rates required by simple stereo audio is no problem unless there is an extreme degree of fragmentation. However, occasionally defragmenting your hard drive can't hurt, so it's worth doing it now and again.


When I record to hard disk I'm only getting one channel

This is most often caused by using a mono minijack. (
Here are pictures of mono and stereo mini-jacks). A soundcard's line input is a stereo minijack socket. It is easy to recognise the difference between mono and stereo minijacks: a mono minijack has one thin plastic ring near the tip of the connector, whereas a stereo one has two plastic rings.

The other possibility is that you have accidentally plugged into the soundcard's microphone input (some mic inputs are mono), although in most cases feeding a line level signal into a mic input causes serious overload distortion.


How do I burn an audio CD with multiple tracks but no gaps between the tracks?

There are two basic ways to burn an audio CD. These are known as "Track at Once" (TAO) and "Disc at Once" (DAO).

When a CD is burned in TAO mode, the laser is switched off between each track, and by default this causes a gap (usually 2 seconds) between the tracks. Some CDR drives allow this gap to be adjusted, and some CDR writing software allows you to set the gap if the hardware supports it. In extreme cases it may be possible to set to inter-track gap to 0. Whether this achieves what you want depends on the hardware's ability to pick up precisely where it left off, and in most cases even with a gap of 0, there will be a tiny but noticable "tick" between the tracks.

To get the desired effect of multiple tracks with no gap whatsoever between them, it is usually necessary (and certainly more reliable) to burn the CD in DAO mode. Here, the entire CD is written in one go, without the laser being turned off at any stage. The disadvantage of doing it this way is that you can't build up your CDR in steps; you have to have all the tracks prepared and ready on hard disk so the whole disk can be written.

There are two ways to get the track positions in the right place when burning in DAO mode. Which one you need to use depends on the way your CDR writing software works:

  1. Some software requires that each track be in a separate WAV file. The best known package like this is Adaptec Easy CD Creator. If you have a single large WAV file containing many tracks, it will need to be split into multiple WAV files. It is important that these splits are made on CD block boundaries (a CD block is 1/75th second, ie. 588 samples), otherwise they will be padded out to the next block size by the writing software. Two suitable packages which can split WAV files on block boundaries are CD Wave and Wave Repair.

  2. Other packages can write a single large WAV file and insert track markers on-the-fly as the CD is burned. The best known package like this is CDRWin. The desired position of the track markers must be supplied in a text file called a "Cue Sheet", which can be written by hand using any suitable text editor; the documentation with the CDR writing software will describe the required format. Alternatively the above-mentioned CD Wave and Wave Repair can both create Cue Sheets for you.


How do I create a CD with "countdowns" between tracks?

Every track on a CD can have multiple indexes, but must have at least index 1, which is where the CD player starts playing the track if you skip to it. If the track also has an index 0 preceding index 1, then when the CD player passes this point, it increments the track number and starts counting down; when it gets to index 1, the countdown is complete and the display starts counting up again.

So, if you want to make a CDR with these "countdowns", you must place index 0's at the appropriate places. Many CD writing packages don't have the ability to do this, but two I know of that can are CDRWin and CD Architect.


How do I put "hidden" music before the first track on a CD?

(First, read the
preceding topic which explains the significance of index 0 on a track).

A hidden track before the start of a CD (the type where you must start playing track 1, then search backwards to get to it) is simply music placed in index 0 of track 1. When a CD player begins playing the disc it starts at index 1 of track 1, so the hidden part doesn't normally get played.


What's the format of a WAV file?

A WAV file is a particular type of RIFF file. The possible formats for RIFF files are quite extensive, but here I will describe a straightforward WAV file, which is a RIFF file containing just one WAV data chunk.

Header in C-speak:

    struct WAV_format
    {
        char riff[4];               /* the characters "RIFF" */
        unsigned long file_length;  /* file length - 8 */
        char wave[8];               /* the characters "WAVEfmt " */
        unsigned long offset;       /* position of "data"-20 (usually 16) */
        unsigned short format;      /* 1 = PCM */
        unsigned short nchans;      /* #channels (eg. 2=stereo) */
        unsigned long sampsec;      /* #samples/sec (eg. 44100 for CD rate) */
        unsigned long bytesec;      /* #bytes/sec (see note 1) */
        unsigned short bytesamp;    /* #bytes/sample (see note 1) */
        unsigned short bitsamp;     /* #bits/sample (see note 1) */
        char otherstuff[N];         /* N = offset-16 (see note 5) */
        char dataheader[4];         /* the characters "data" */
        unsigned long datalen;      /* #bytes of actual data */
    };
Immediately following this header are the actual bytes of data, interleaved by channel. For example, in a 4-channel 16-bit WAV file, the first two bytes are the first sample of channel 1, the next two bytes are the first sample of channel 2, the next two are sample 1 of channel 3, then sample 1 of channel 4, then back to channel 1, etc.

Notes:

  1. #bytes/sec should be set to the number of bytes for all channels (eg. for stereo 16-bit 44.1kHz, this should 176400); #bytes/samples should also be set for all channels (eg. for stereo 16-bit, this should be 4, not 2); #bits/samples should be set for a single channel (eg. for stereo 16-bit, this should be 16, not 32).
  2. WAV format requires the samples to be stored as Intel format integers (ie. least significant byte first) rather than, for example, Sparc format (most significant byte first).
  3. For stereo data, channel 1 is left, channel 2 is right. I don't know the assignment for multi-channel (or even if there is a standard).
  4. Following the actual WAV data, extra descriptive text may be present, which should not be processed as audio data; applications may put in stuff for their own purposes at the end (eg. copyright notices).
  5. "otherstuff" is extra header data that may be present in WAV files written by some utilities. Most utilities do not write anything here (so N=0), but be aware that it might be present.