# The &krec; Handbook

## Introduction

### Why I wrote &krec;

After some working with &arts; I realized that there is no recording frontend for it except the command line tool `artsrec`. I had to record a radio play some friends of mine wanted me to mix and master and I wanted to use &Linux; for the recording. So I started writing &krec;.

### What &krec; does

&krec;'s function is quite simple. It connects to the &arts; server and records what is routed to it into a file.

At the moment it only writes raw files, which are the same as normal Wavefiles but without the wav header (sox can add this header fo you).

## Using &krec;

This chapter describes the usage of &krec;. There are several ways of using &krec; so I created some HOWTO-like sections describing this possibilities of usage. Just read the first paragraph of each and decide what you need to read. Or read everything and learn about the fantastic possibilities of &krec;.

Here's a screenshot of &krec; Here is a screenshot of &krec; right after it started.

### Recording of a simple file

If you hear something on the radio you want to record (and your radio is plugged into your soundcard) there is a (relatively) fast way to record.

1. First you have to select the recording source in your soundcard. You need your favorite mixer (&kmix;), where you should select the source you need for recording. You also need to configure the &arts; server for full-duplex (and your soundcard and drivers should support this too). If you need to restart &arts; you should also restart &krec;

2. Then you need to open &arts; Control and its Audio Manager. It shows two new Items: &krec;::In and &krec;::Out, the latter is used for playback and play-thru and is irrelevant here. The former needs our attention; it should be connected with the in_soundcard bus. If you can't select it you probably misconfigured something (no full-duplex or something like this).

3. If everything worked you now should see something moving inside &krec; — the VU-Meter showing how loud your recording is. For good recordings without clipping it should be yellow to orange but not red. The slider right of the VU-Meter controls the volume.

4. Now you need a file to record to. Use File New File or the toolbar symbol to create it. After that you need to tell &krec; to record to this file. That is done in the context menu of the file item.

5. Now you are able to start recording. Use the big red button in the toolbar or Play Record or simply press R. To stop use the stop button or the entry in the Play menu (or the key S).

Okay, it is not as fast as pressing the record button on your tapedeck but &krec; has some more features than your tapedeck, believe me.

You may want to record other things. For testing you can take the output signal of &noatun;: Set &krec;::In to the out_soundcard (or any other bus you let &noatun; play to). This even works if you don't have a full-duplex enabled &arts;.

### Recording several files

For this section we assume you want to record several small or bigger pieces into several files. For example, you want to record scenes for a radio play or something like that. (That was the reason I wrote &krec;.)

I assume you have worked with &arts; before and know a bit about the topic Audiorecording. Your mic, or whatever you want to record from, should be plugged into your computer and you should know what to configure (outside &krec;) to get the input signal recorded.

This walk-through uses a radio play as an example. We have to decide wether we want all the recordings to be named differently or we want to name some or all recordings by the same name, differing only in a number. For the first, follow the instructions in simple-usage and keep in mind that you can open several files at the same time and then choose which one to record to. The second is described here...

1. Before we start be sure you have everything set up correctly, particularly that you are really recording what you want. You can confirm that everything is alright if the VU-Meter in &krec; is moving. If you are not recording from out_soundcard you can select Play Play Through to get the recorded signal put through to your soundcard output, which I would do rather then listening to it via your soundcard mixer because you can hear if it is too loud or too quiet.

2. For several files with the same name you need a session. File New Session should do it. Select the path and enter a filename which gets expanded with the number and the postfix of the recording.

3. You still need files to record to but this time you create them by selecting New File from the context menu. You can create as many files as you want/need.

4. The rest is simple: Select the file you want to record to and then record...

A session is not another MIME type, or even a file. It is just an internal thing to organize the numbering. So you can not later re-open a session and continue recording to new files...

### More tips and comments on usage

There are some more things to say and some more elements to explain.

#### Using Play-Through

For those of you who want to hear what they are recording there is a very useful Play-Through option. It is found in the menu Play. I advise using it as much as possible especially if you do other things like using the compressor or other effects as well. See internals for details on the connections.

Be sure to not build a feedback loop while recording from out_soundcard and activating Play-Through. Such a loop is to much for poor &arts; and it slows your system way, way down! You might kill &arts;...

#### Using the compressor

If you are recording with a microphone you might notice that the level is sometimes almost clipped and sometimes very low especially when recording speech. To correct this you can use the compressor. It simply reduces all sound that is over the given threshold by the factor given in ratio. As this reduces the loudness there is a output potentiometer to expand (or reduce) the sound. Attack and Release let you control the time after which the compressor reacts (the time going by after input first exceeds the threshold) and the time the compressor still reacts after sound is below the threshold.

Test it while you are speaking into your microphone with Play Through enabled and you will hear the difference.

#### Switching between several files

Like you can open several files for recording, you also can switch between them. This can be done not only after you stop recording, but also while you are recording. Note that some data packets can be lost while doing this. How much sound information this is depends on the size of your Audio Buffer configured in the &kcontrol; for &arts;. It shouldn't be that much but if you play the files directly one after the other (for example with `artscat file*.raw`) you can hear some small jumps.

### Internals

Let me say something about the sound connection in &krec;.

There are some items needed for recording with &arts;: a synth_AMAN_RECORD, a AudioToByteStream converter and a ByteStreamReceiver. The first two are build inside the &arts; server. The latter is inside the application. But that's only the basics. If you want to listen to the files you need a ByteStreamSender inside your application and a ByteStreamToAudio converter and a synth_AMAN_PLAY inside the server.

What about the effects? Between the AMAN_RECORD and the AutioToByteStream I plugged a StereoEffectStack into which I put the compressor (synth_STEREO_COMPRESSOR) and a volume control (StereoVolumeControl).

If you enable Play Through the effects stack also gets connected with the AMAN_PLAY. So this is all inside the &arts; server...

## Command Reference

### The main &krec; window

#### The File Menu

N File New File

- Creates a new single file for recording into one file

&Ctrl;N File New Session

- Creates a new session for multiple recordings

&Ctrl;Q File Quit

- Quits &krec;

#### The Play Menu

P Play Play

- Plays the file selected for playback.

R Play Record

- Starts the recording into the selected file.

S Play Stop

- Stops the recording.

&Ctrl;P Play Play thru

- Connects the input with the output to let you hear what you are recording. (&krec;::In and &krec;::Out in the audio manager of &arts; control)

  Never use this while recording what you hear (from out_soundcard). This gives feedback which &arts; is not able to handle. (It does not ieck because &arts; is faster then feedback from your box to the microphone.)

#### The Settings Menu

Settings Show Startup Window

- Toggles whether the startup window with the quick tutorial is shown.

#### The Help Menu

&help.menu.documentation;

### The startup window

This startup window is almost the same as the &ktip; dialog.

## Questions and Answers

&reporting.bugs; &updating.documentation;

I recorded some files with &krec;, but I can not play the files with my favorite player?

&krec; (currently) records only into raw files, not real wav files. For converting you can use sox, for example:

### Converting raw files to real Wave files with sox

To convert a raw file recorded with &krec; use the following command line inside a console (&konsole;), assuming `sox` is installed. In the example, the file is called test.raw and wants to be converted to test.wav. Use your own filenames for that.

    %sox -r 44100 -c 2 -s -w test.raw
    test.wav

The options `-r 44100 -c 2 -s -w` tell `sox` that you recorded with 44100kHz sampling rate, two channels (stereo), encoded signed linear and 16bit words. You may have to use other options for your setup - look at the man page of `sox`.

## Credits and License

&krec;

Program copyright 2002 Arnold Krillearnold@arnoldarts.de

Documentation copyright 2002 Arnold Krille arnold@arnoldarts.de

&underFDL; &underGPL;

## Installation

### How to obtain &krec;

&install.intro.documentation;

### Requirements

In order to successfully use &krec;, you need &kde; 3.1.

&krec; should be within your kdemultimedia package. As this package needs a running &kde; and &arts; too, everything should be fine.

### Compilation and Installation

&install.compile.documentation;
&documentation.index;