But only if you have right tools installed in your distro. Often, some most popular Linux distribution like Red-hat / Fedora do not come bundled with mp3 support. Here is quick take for you to how to do this.
Step 1 - Download and install LAME MP3 codec. LAME MP3 encoder and decoder are essential tool to record and play your sound file in MP3 format.
Step 3 - Play your sound file, or attach your sound source to Line in of your computer's sound card. Make sure that you can here the sound.
Step 4 - Start Audacity. Click the drop down menu beside the Microphone icon, and select the input sound source. For example, if you want to record audio from external source such as CD / Cassette player, then select Line in. You can also choose Volume/Stereo Mix. Now start playing the music/sound that you want to record, and press Record button (the button with red circle) . For best results, experiment a little with sound input level.
Step 5 - When done, click Stop button (the yellow square button). Now you can save your recording in wave file format. To record in other sound file format, you must have installed compatible sound encoder in your computer. For example, here, we want to save our recording in MP3 file format. Audacity needs LAME MP3 encoder, which we have already installed, and for the first time it may ask you to locate that file. Simply click on File menu and then go to Export as MP3. Audacity will then ask you to fill in MP3 tags, which you can supply, or you can skip this step, and click OK. Your recorded files will then be exported in MP3 file format