- Home
- Learn Linux
- Learn Electronics
- Raspberry Pi
- Programming
- Projects
- LPI certification
- News & Reviews
I a few years ago to capture some audio input onto a computer. I tried using Windows and I was hoping to use freely available software. I was not able to find any that was able to do what wanted.
This time I had a more pressing requirement to capture from a tape to a CD. The requirement was to convert some piano music that had been captured onto tape (using the lineout on an electronic piano).
There are some legal issues to capturing audio in this way. There are legitimate reasons to do this. If you own the full copyright to the source then there is no problem. If you are wanting to copy from a DRM (Digital Rights Management) source or you are going to be selling copies on then it is most likely illegal (depending upon local country laws). If you are wanting to copy records that you own on vinyl, then the case it not quite so clear. For example its generally considered OK to copy CDs into iTunes to then download onto an iPOD, although again I do not know the legal status of this.
I am not a lawyer so cannot give any legal advice. If you are looking to copy copyright material then you should check the legal status in your country.
In this case we are taking an analogue audio output from the device and then converting it to a digital computer file. It is therefore not recommended for digital sources as the sound will be converted from digital to analogue and back to digital. This would risk distorting the audio from the original source.
You will need some kind of sound capture on your computer. Most sound cards, or built in sound controllers will have a line-in port. The hardware needs to be supported from Linux, although generally I've not had many problems with audio support.
The other thing you need is an audio player with some kind of electronic output. There preference is for a line-out output, as this will be impedence matched with a line-in. If this is not available then a headphone socket can be used. I did have a problem with this initially as I first tried a tape player which didn't have a headphone out, then found another with audio out, before realising it didn't have a tape player (it was CD and radio only). I finally got my old hi-fi system out of the loft which had both a tape player and audio-out.
The player then needs connecting to the sound card. This will normally be using a 3.5mm to 3.5mm jack cable. In my case I also needed an adaptor from 3.5mm jack plug to a 1/4inch jackplug.
First I tried this using my Laptop (Thinkpad T22) which was installed with Ubuntu Linux. I was not able to get this working. I tried posting to Linux Questions, but still haven't resolved my problems. If anyone has any suggestions please either comment on this thread or
These instructions are on Fedora FC5 using the KDE Audio utilities.
First full duplex needs to be enabled for the sound card.
This is done by running:
$ kcmshell arts
at a command shell. This launches a GUI configuration tool, and the Hardware tab includes a Full Duplex option which needs to be turned on.
I also had a couple of problems where the card stopped capturing audio. I also used this tool which performed a sound system restart, and allowed recording again.
When trying to get the recording to work I turned off the Auto-Suspend, which is also in the "kcmshell arts" panel. If you do this then you will need to turn auto-suspend back on if using none KDE programs to playback music (as I did later).
Use KMix to adjust the sound levels, in this case enabling and turning up Line. This can be tested by listening for the output on your speakers as well as watching the bars in Krec (see later).
Run Krec which is the application that will record the input. File -> New will give you "file with no name", this can be used to record into by pressing the record button. You should see green (and maybe yellow) bars in the recording level on the left hand side. If you don't see anything then you may need to restart the sound system (kcmshell arts), or adjust the volume (KMix). If the bars turn red at all then you need to turn the volume down to prevent clipping (KMix).
I don't know of anyway of auto-stopping the application, so you need to return to the application when the source music reaches the end. If you leave it longer then you just end up with a bigger file (which can be trimmed later). If the program is left running too long then it takes a long time to load and edit later, when it comes to trimming the file.
After it is complete you can export the entire track as a wav file.
To split the music into individual tracks I used "sweep". This needed to be installed separately using "Add/Remove Software".
The above screenshot shows a loaded file, with 3 songs which need to be separated into individual tracks. The cursor is between the first and second song.
To split these into individual tracks I selected a song, cut it from the main file and then used "Paste as New" to create a new window with the song loaded. I trimmed off any long pauses using the delete option and then saved it under a new filename.
I then recorded to CD using GnomeBaker, alternatively K3B could be used (needs to be installed separately).
I also created a CD case and printed CD labels using OpenOffice.org. I created these manually, but since then I have found some templates that could have been useful at OO Extras.
I also wanted a copy of the sounds as MP3, so that I could play them on my MP3 player. See: Linux Hardware Review: Akai 256MB MP3 Player with SD Slot.
To do this I created a small shell script. The script is listed below:
#!/bin/bash
for i in *.wav; do lame "$i" "`basename "$i" .wav`.mp3"; done
This is a very basic script, which I saved in /usr/local/bin called wav2mp3, and it's permissions set to allow it to be executed (see - chmod in Linux Useful Command Reference Tutorial). You need to be in the same directory as the wav files and then run the command. It takes all the wav files and creates a corresponding mp3 file, with the extension changed to mp3.
Finally I copied the tracks onto my SD card for using in my MP3 player.