# The &kapp; Handbook

## Introduction

This is "&kapp;", a simple sound editor for KDE3. Its features include:

- simple cut, copy and paste functions

- multi-level undo/redo

- labeling of signals

- Recording functionality, including pre-recording

- Playback via aRts, ALSA and OSS

- Recording via ALSA and OSS

- MP3 import

- Ogg/Vorbis import/export

- FLAC import/export

- some analysis functions such as Sonagram

- internally uses 24 bit fixed precision for sample data

- free selectable sample rates

- support for editing of multi-channel files

- playback of multi-channel audio files (audio output will be mixed down to mono or stereo)

- extendible through an easy-to-use plugin interface

- import/export of other audio formats through audiofile

If you are interested what has been done and what has still to be done, then look at the files `CHANGES` and `TODO` included in the source package. Help and constructive critics are always welcome.

### &kapp; Resources

So if you want to get in contact with the developers, need some further help on using &kapp;, submit patches, bug reports or other stuf, the following resources might be of interest for you:

- Project Homepage

  For informations about new up-to-date releases or some other information about this project, take a look at the &kapp; homepage

- Mailing List

  If you need some help on using &kapp; or want to get involved in the development, join the Kwave developer mailing list by visiting "https://lists.sourceforge.net/lists/listinfo/kwave-devel".

- SVN Repository

  There also is a SVN repository, hosted by SourceForge where you can get the sources of the latest development version. For instructions on how to get access to the repository, read in the chapter about building from SVN, look at "http://sourceforge.net/svn/?group_id=6478", or just browse through the SVN tree through a nice web interface.

### &kapp; Revision History

This project has been started by Martin Wilz in summer 1998 and has been developed and improved by him an some other people. In November 1999 Thomas Eschenbacher has started to fix some little bugs here and there and stepped into the source code of the program deeper and deeper. Up to today he has extended, rewritten or revised nearly every component of the program and spent much time on improving it.

- 0.7.11 [2007-12-09]

  - new internal streaming architecture, based on Qt instead of aRts

  - aRts support is now disabled per default

  - some minor bugfixes for x86_64 support

  - band pass plugin

- 0.7.10 [2007-08-08]

  - build system: using 'METASOURCES=AUTO' (which simplifies a lot)

  - ported the build system to cmake

  - support for newer APIs of FLAC v1.1.3 and v1.1.4 (closes SF bugs #1713655 and #1757716 + debian bugs #427747, #426668 and #431199)

  - replaced problematic code in libaudiofile with new code under the LGPL, contributed by Bertrand Songis (partially fixes debian bug #419124)

  - update of the online documentation to reflect the change of the make system

- 0.7.9 [2007-05-01]

  - playback via ALSA: offer the "default" device, if no devices found offer the "null" device

  - implemented import and export of labels, currently only for uncompressed wav files

  - new plugin for saving blocks between labels as separate files

  - new function: expand selection to labels

  - new function: select next/previous range between labels

  - bugfix: don't change the file name when saving only the selection

  - new configure option: --enable-doc=yes/no to enable/disable the generation of the online documentation (default=yes)

- 0.7.8 [2006-12-31]

  - bugfix: workaround for bug in ALSA, crashed when initializing the dsnoop plugin

  - bugfix: error in swap file handling, one sample was destroyed when resizing. Affects cut, delete, crop and many other functions.

  - fixed the incorrect usage of the word "loose" (thanks to J.T. Hundley)

  - bugfix: went back to old implementation of ThreadsafeX11Guard class in order to fix a deadlock (closes sourceforge bug #1623357)

  - documentation update: mention Subversion instead of CVS

  - zero plugin: new mode, support for inserting a range filled with silence

  - fixed the macro functions "Fade Leadin" and "Fade Leadout", using the new mode of the 'zero' plugin

  - export of ASCII format files

- 0.7.7 [2006-09-17]

  - new feature: implemented a small widget that shows the current selection position and the selection borders

  - new feature: context menu for the signal widget (right mouse button)

  - improved file open dialog: show "All Files" and "All Supported Files"

  - bugfix: error in handling of mouse selection

  - bugfix: recording only used the first channel (closes sourceforge bug #1551050)

  - install plugins kde_moduledir/plugins/kwave instead of kde_datadir/kwave/plugins

- 0.7.6 [2006-06-05]

  - bugfix: recording setup crashed when called for the first time

  - bugfix: do no longer crash when recording device is not present or opening failed

  - bugfix: fixed generation of rpm dependency for libmad

  - bugfix: update the size of the level meter if the dialog size has changed

  - record plugin: added a fancy status bar

  - record plugin: added autodetect/scanning for OSS devices

  - record plugin: added dsnoop plugin as ALSA source

  - record plugin: fewer annoying message boxes, instead show a short notice in the status bar for some seconds

  - record plugin: add logarithmic scale to the level meter and use 3 colors

  - playback plugin: added autodetect/scanning for OSS devices

  - playback plugin / ALSA: support for 18 and 20 bits/sample

  - playback plugin / ALSA: support for big endian

- 0.7.5 [2005-12-31]

  - draw signal in a different color set when not selected

  - bugfix: solved deadlock situation when starting a plugin while another plugin was still running

  - workaround for deadlock when trying to close the current file while a plugin is still running

  - bugfix: delete range only in selected tracks

  - thrown over board the idea of using gstreamer due to serious license issues, we will wait until KDEMM is out (KDE-4) instead.

- 0.7.4 [2005-10-16]

  - recording via ALSA

  - support for the silently changed API of libFLAC++ v1.1.2 (closes sourceforge bug #1243707 + debian bug #289953)

  - fixed support of MMX / SSE detection on X64_64 architecture (closes sourceforge bug #1244320 and debian bugs #288781 + #327501)

  - decided to support gstreamer as streaming engine in future versions (will make v0.8 if Kwave is aRts-free)

  - fixed some German translations (closes debian bug #313790 and bug #314000)

- 0.7.3 [2005-05-26]

  - playback via ALSA

  - completely new playback settings dialog, with support for aRts, ALSA and OSS

  - playback plugin: play a test sound

  - record plugin: detect when device is alread open, now no longer blocks. Show an error message.

  - smoother signal display in overview mode (no gaps) and improved polyline mode

  - replaced some of Kwave's multithreading classes with classes from Qt

  - compiles under SuSE-9.3

  - ebuild file for Gentoo Linux

- 0.7.2 [2004-12-31]

  - big rework of the internal streaming/storage subsystem, support for multiple stripes. Makes a big speedup when handling large files! Creating an empty 512MB file before: over 350 sec, now: about 25 sec (on my system)

  - optimized versions of memcpy() for ix86 (using MMX, MMXEXT, 3DNOW, SSE, SSE2) and for PowerPC, copied from the xine project

  - some support for X86_64

  - bugfix: in memory setup plugin, set virtual memory limit only if the limit has been enabled (checkbox is clicked)

  - bugfix: clipping in Ogg import filter was incorrect

  - speedups: import of Ogg and MP3 files improved

  - removed code copied from the GSL library, link against the shared library instead

  - added target "package-messages" to the toplevel Makefile, for translators

- 0.7.1 [2004-07-10]

  - FLAC (Free Lossness Audio Codec) import/export plugin

  - speedups for loading / saving files

  - removed our own copy of libmad from the source tree, now it should be available in all common distributions

  - implemented pre-recording

  - implemented recording time limit

  - bugfix: minor bug in the recording state machine

  - bugfix: solved some layout issues in the about- and sonagram plugins

  - bugfix: cancel while saving to .ogg works now

  - update of the online documentation, many screenshots

  - improved Makefile dependencies of the plugins, now parallel builds also work and speed up the creation of plugins

- 0.7.0 [2003-12-01]

  - first version with recording functionality (still alpha)

  - removed workaround for uic invocation

  - bugfix: handling of persistent and unique plugins was wrong, which caused playback to work only in the first main window instance

  - added project files for kdevelop-3

- 0.6.7 [2003-06-28]

  - new plugin: "pitch_shift"

  - new plugin: "lowpass"

  - new plugin: "notch_filter", contrinuted by Dave Flogeras

  - included a bugfixed version of the synth_pitch_shift aRts plugin

  - new feature: "pre-listen", first implementation in pitch_shift plugin

  - ported to work with Qt-3.1 without Qt-2 compatibility, also compiles with -DQT_NO_COMPAT -DQT_CLEAN_NAMESPACE

- 0.6.6 [2003-03-29]

  - works with KDE-3.1

  - many improvements on the build system. Now compiles under Debian, Mandrake, RedHat, Gentoo and SuSE

  - starting up with last window size

  - Xt toolkit option for geometry works again, including workaround for bug in KDE3's geometry management. example: "kwave -geometry 800x600"

  - bugfix: select to left selected one sample less then needed

  - volume plugin: simple clipping

  - volume plugin: mode for "multiply with /divide through factor"

  - newsignal and selectrange plugin: got rid of KDoubleNumInput and it's weird display and entry behaviour

  - selectrange plugin: also select start position of selection

  - can use libmad and libaudiofile from the host system if usable

  - show the fileinfo plugin when saving under a different mime type

- 0.6.5 [2002-11-09]

  - MP3 import with ID3 tag support through id3lib and libmad

  - Ogg/Vorbis import and export (only ABR mode)

  - new plugin "volume"

  - show selected range as time (feature requested by Christian Hollaender)

  - support for saving compressed .wav files

  - thrown away Qt2/KDE2 compatibility, now only supports Qt3/KDE3

  - playback plugin: enabled the "select..." button for choosing other playback devices (feature requested by Len Ovens)

  - solved problem with name mangling in plugins and different gcc versions

  - works with gcc-3.2 / solved __dso_handle problem

  - stricter checks for programs in configure script

- 0.6.4 [2002-06-30]

  - support for different file formats / integrated libaudiofile

  - drag and drop bugfix: dropping into the same signal left from the selection removed wrong range

  - auto-repair for structurally damaged wav files

  - bugfix: save selection works again

  - integrated libkwavemt into libkwave

  - using time instead of zoom factor, e.g. set zoom to "1 minute" (feature requested by Gilles Caulier)

  - menu entries for playback control

  - some more icons in the menues

  - replaced KFileDialog with subclass KwaveFileDialog (works around some bugs in KDE)

  - added a little chapter about digital audio basics to online help

  - added "select range" plugin

- 0.6.3 [2002-03-01]

  - simple drag and drop

  - french translation

  - handling of "signal modified"

  - shows error message and aborts if loading failed

- 0.6.2 [2001-12-24]

  - new plugin "amplifyfree"

  - new plugin "noise"

  - new aRts plugin adapter framework now Kwave is able to use existing aRts plugins in it's own plugins for sound processing

  - changed documentation to XML / Docbook-4.1

  - recovery of damaged files if non-zero file length but data length entry in the wav header is zero (e.g. happens when krecord crashes during recording)

  - bugfix: freeing virtual memory fixed in MemoryManager

  - bugfix: problem with TSS in TSS_Object cleanup

- 0.6.1-1 [2001-09-01]

  - bugfix: class Track made duplicate entry in stripe list when inserting signals into an empty track

  - fixed that weird layout behavior in dialogs, seems that Qt has problems with complex nested layouts :(

- 0.6.1 [2001-08-24]

  - USE OF VIRTUAL MEMORY

  - changed Makefiles: html docu stays in distribution due to too much trouble with the KDE documentation tools

  - when inserting from clipboard into a signal with a different number of tracks, the result will be mixed (still not optimized/slow)

  - fixed compile problem with gcc-2.96 / gcc-3.0

  - fixed missing header file in NewSigDlg.ui

  - the RPM should be relocateable again

  - fixed bug in shutdown sequence, now clipboard is flushed before the application closes.

- 0.6.0 [2001-07-29]

  - PORTED TO QT-2 AND KDE2

  - completely new internal architecture

  - plugins can be located in a user directory

  - libkwave is included and no longer supported (at least by me) as a separate package

  - playback via aRts

  - many more bugfixes, too many to mention here...

- 0.5.5-1 [2001-02-23]

  - bugfix: selection across end of file no longer possible

  - bugfix: no overflow in wav header when saving large wav files above 268MB (bug reported by Sven-Steffen Arndt, ssa29@gmx.de )

- 0.5.5 [2000-12-01]

  - new playback handling, allows pause/continue

  - limited the playback buffer to be between 256 and 65536 bytes due to problems (system hang) with small playback buffers with 16..64 bytes (might be a hardware problem)

  - introduced a toolbar for some standard operations

  - fixed some bugs concerning selection with the mouse

  - rework of the overview widget (used in main window and sonagram)

  - fixed menu command "zoom selection"

  - sonagram: saving to file, auto-brightness adjust

  - replaced QFileDialog with KFileDialog

  - tested with AMD Athlon-optimized compiler (patched pegcs)

  - some fixes for safer multithreading

  - checking for much more header files at configure time (due to a problem reported by issiac@evcom.net )

- 0.5.4-4 [2000-10-03]

  - added classes Mutex and MutexGuard

  - sonagram: set a transparent background for the image

  - added sizeHint() and minimumSize() to ScaleWidget and OverViewWidget

  - sonagram: removed (need for) SonagramContainer, using QGridLayout instead

  - moved SignalProxy to the mt subdirectory

  - fixed X11 synchronzation problem with SignalProxy

  - added TSS (thread-specific-storage) support to the mt classes

  - added some multithreading support classes: Thread, AsynchObject, ...

  - removed the "get" prefix from all member functions. This is the new KDE/QT coding style.

  - updated the online documentation to point to the new Kwave homepage on http://kwave.sourceforge.net/

  - class ImageView: always repaints (maybe image data has changed)

  - bugfix: selection and playpointer will not be drawn if no signal is loaded

- 0.5.4-3 [2000-09-09]

  - the sonagram window updates it's title if the signal's name changed

  - found a solution for the problem of synchronizing X11 and QT in a multithreaded environment

  - fixed bug in the "Halt" function (playback)

- 0.5.4-2 [2000-08-20]

  - geometry/layout management for the MainWidget

  - limited the displayed height of a signal. If not all signals fit onto the screen, a scrollbar appears on the right side of the signal.

  - limited the size of the TopWidget to a reasonable minimum size

  - automatic dependencies for the plugins work again

- 0.5.4-1 [2000-07-29]

  - fixed layout of playback dialog

  - started to implement a new plugin interface

  - geometry/layout management for the sonagram settings dialog

  - formatting of selection and file time (KwavePlugin::ms2string)

  - plugins can now consist of multiple source files

- 0.5.4 [2000-07-12]

  - some more minor changes to the Makefiles

  - split the documentation output into "de" and "en" part

  - made symbolic links to the english help directory from the "de" and "default" directory during make install and uninstall and also in the post and postun scripts of the specfile The user should at least get the english help...

  - alpha version of english documentation done

  - automatic update of the revision history in the docbook file if this file is modified (only english version)

  - CVS is up on sourceforge.net

  - changed some header lines in this file

  - started on writing a new documentation / online help using docbook

- 0.5.3 [2000-06-12]

  - if a file with invalid size (e.g. recorded by "arecord") is loaded, shows a message and truncates the input at the end of the file

  - found out that we need ALSA support for 24 and 32 bits/sample

  - playback in stereo

  - selected channels (x) are mixed to the output device's channels (y) at playback using a x:y translation matrix with linear scaling, all values for x and y except zero are allowed

  - playback only for selected channels

  - rework of the settings/playback dialog (plugin)

  - heavy reword on the playback code

  - fixed severe bug in SignalManager::readWavChunk(), chrashed if there was data after the wav chunk

- 0.5.2-12 [2000-06-02]

  - copied the AsyncSync class into libgui, should be used for threadsafe usage of the qt library

  - moved handling of the "selected" flag from class SignalManager to class Signal

  - fixed selection of channels if appended or deleted

- 0.5.2-11 [2000-05-28]

  - included config.h in each source file (except the plugins)

  - export to ASCII for multi-channel signal (multi-channel import has still to be done, currently only mono)

  - fixed many memory leaks and inconsistent delete operations (e.g. used "delete" instead of "delete[]")

  - included support for (and tested with) the error detection and memory debugging tool "Insure++ Lite 4.1" (./configure --enable-insure=yes ...) -> thanks to ParaSoft Corporation for making this limited version of the tool available (http://www.parasoft.com)

  - SignalWidget uses three layers for drawing, speeds up the redraws after mouse selection by about factor 14(!!!) on my system :-))

- 0.5.2-10 [2000-05-21]

  - some minor bugfixes in the Makefiles

  - save the kwave.spec and include it into the source archive, this lets "rpm -ta kwave-x.x.x-x.tar.gz" work

  - wrote a new README file, moved Martin's version to README.OLD

  - RPM_OPT_FLAGS are appended to the compiler options, this lets pentium optimizations work :-)

  - shows a message box if loading of a file failed

- 0.5.2-9 [2000-05-19]

  - list of recent files is synchronized across all toplevel windows

  - fixed dozens of memory leaks, missing ASSERT constructions, missing variable initializations and possible divisions through zero

  - Help menu aligned to the right side (MenuRoot now is able to process the special command "#separator")

- 0.5.2-1...0.5.2-8 [...2000-05-18]

  - replaced all occurances of sprintf with snprintf, strcpy with strncpy (in 92 places) !

  - doesn't show any zoom factor if no signal is loaded

  - handling of channel add/delete: selection/speakers are shifted

  - changed some variables/parameters to "unsigned" (simplifies range checks)

  - beautified this file

  - beautified the whole source code according to my favorite coding style. -> thanks to the developers of the "Artistic Style" package, astyle-1.11.4-1 made good work :-)

  - fixed that annoying flicker in the help/about dialog

  - checking for sizes of char, short and int at configure time

  - globals.app will not be used (obsolete, should be removed from libkwave)

  - MessagePort will not be used (obsolete, should be removed from libkwave)

  - multiple toplevel windows are possible

  - made X toolkit parameters work (especially "-geometry")

  - bugfix concerning loading/saving 8 bit .wav-files (always unsigned !)

  - COMPLETE REWORK OF THE INTERNAL COMMAND STRUCTURE

    - made use of a combination of signals/slots and string messages

    - hierarchical processing: commands are are forwarded "upwards" until they reach a TopWidget

    - the TopWidget (highest level) dispatches the comands and forwards them to the lower levels

- 0.5.2 [2000-04-24]

  - rpm package should now be installable without conflicts and compile without any previous installation of kwave

  - removed the "${KDEDIR}/share/doc/HTML/default" directory from the rpm so that it doesn't conflict with the already existing one

  - shift+Home/shift+End selects from the current left/right position up to the start/end of the signal

  - bugfix in display of signal: signal is no longer inverted

  - selectrange() works now

  - the zoom factor combo box reflects the current "real" zoom factor

  - some bugfixes in menu handling / cleanups

  - complete rework of zoom and offset handling:

    - simple poly-lines instead of lowpass interpolation if zoom factor has less than 10 pixels per sample

    - lowpass interpolation if more than 10 pixels per sample

  - bugfix in KWaveApp: now sets globals.app to this if it was null before, now doesn't crash if it loads a file specified at cmdline

- 0.5.1-4

  - now compiles and runns under RedHat 6.1 / Halloween IV as well as under SuSE 6.2

  - version info of libkwavegui.so is set to the package's version

  - bugfix in plugins/template/Makefile.am: will not create .moc files on make distclean and other targets

  - compiler flags are passed through to plugin compilation

  - compiling with --no-rtti. This was necessary to compile against the kde libraries of RedHat that seem to contain no rtti. As a side effect all warnings on linking programs/libs disappeared :-)

  - configure-parameter --enable-debug has effect again

  - ASCII import and export works now (mono only)

  - bugfixes in some plugins, all compile now without warnings/errors

  - plugins are processed in alphabetical order

  - all plugins are automatically found and compiled

  - new target "make src.rpm" makes only the source rpm

- 0.5.1-3

  - display will be scrolled left or zoomed if something from the end of the signal is deleted

  - curve parameters of fade in / fade out work again

- 0.5.1-2 [2000-03-16]

  - converted many "klocale->translate(...)"s into "i18n(...)"

  - target "make messages" works again

  - converter for menus.config, creates a dummy .cpp-file that is handled by i18n

- 0.5.1-1 [2000-03-13]

  - new target "make rpm" creates binary and source RPM packages

  - fixed the shared-library-problem in the build system

- 0.5.1 [2000-02-28]

  - menu items can belong to groups

  - renamed SignalWidget::info to "refresh"

  - many cleanups in the header-Files in src and libgui

  - the menu management has completely been rewritten:

    - Menu, NumberedMenu and MenuCommand classes are deleted

    - new classes: MenuNode, MenuItem, MenuSub, MenuToplevel and MenuRoot

  - menu items can have icons

  - menu nodes can have unique string ids

  - special menu commands start with a "#"

  - first attempts for internationalization

  - list of recent files is sorted by time of last usage

- 0.5.0-1 [1999-12-27]

  - moved my modifications from the Makefiles to Makefile.am

  - included targets "make release", "make patchlevel" and some scripts

- 1999-12-19 (by Thomas.Eschenbacher@gmx.de)

  - remade my modifications of some Makefiles and of the configure script that were lost during Martin's changes

  - changed shortcut for mixpaste from CTRL-SHIFT-X to CTRL-SHIFT-C

  - added the "crop" command to the edit menu

  - made the "mixpaste" command work

  - corrected the call of "delete", now really deletes instead of cutting and copying the selection to the clipboard (saves clipboard content)

- 1999-12-18 (by mwilz@ernie.mi.uni-koeln.de)

  - changed filenames to reflect class names

  - one class per file is now the standard

  - stripped leading "Kwave" in Classnames for most Classes

- 1999-12-10 (by Thomas.Eschenbacher@gmx.de)

  - removed -Werror compiler option (caused trouble with configure script)

  - fixed a nasty bug in SignalManager::save that caused crashes on several positions in the program and libstdc++

- 1999-12-09 (by Thomas.Eschenbacher@gmx.de)

  - gave the destructor of SignalManager some code, this fixes a huge memory leak !

  - added a TODO file

  - added -Werror to the c++ compiler options when debuging enabled

  - some include file cleanups in libgui

- 1999-12-07 (by Thomas.Eschenbacher@gmx.de)

  - SignalManager::writeWavChunk uses buffers for writing (much faster!)

  - bugfix: caption of main window changes after "SaveAs"

  - bugfix: selected resolution takes effect

  - bugfix: caption of main window changes after "SaveAs"

  - bugfix: SignalManager::writeWavChunk now doesn't destroy the signal's data while saving

  - make distclean in the projekt root directory also removes zero-length files, *.orig, *.rej and *~ (just makes cleaner than before)

  - symbolic links to Makefile, Makefile.in and Makefile.am in the plugins directory are deleted with "make distclean" and rebuilt on "make" (changes in the referenced Makefiles in the template directory will not be reflected thousand times when creating a patch with diff)

  - cleanups, removed some old backup files

  - improved support for debugging accessible through

  - "configure --enable-debug=yes" (-g and -DDEBUG compiler flags)

  - rewritten big parts of Makefile.in for the plugins

  - added -O2 compiler optimization

- 1999-12-03 (by Thomas.Eschenbacher@gmx.de)

  - merged with Martin Wilz's version

- 1999-11

  - version numbering script donated by Thomas Eschenbacher

  - now using KTMainwindow for top level widgets

  - using timer to check message port -> alternative (threadsafe) message passing instead of signal/slot

  - labelling code rewritten, now incompatible with old releases

  - batch loading routines

- 1999-10

  - deleting channels works again

  - fixed savelabel dialog

  - corrected envelope dialog, string handling

  - connected many functions via the new string-based way of invocation

  - fixed some dependencies between old code and new classes (there's still more to do !)

  - saving should now work again

  - trimmed down Clipboard class

  - Color class as wrapper to QColor (may become independent later)

  - reworking Curve Class for creation via string, interpolation now uses curve objects

  - moved gui functions into a new library (libkwavegui)

  - new Classes: Parser DynamicLoader Filter (prevously was a struct)

  - moved gui-independent functions into a library (libkwave)

  - rework of dialogs into single files and single plugins

  - new calling scheme via string commands. This will allow scripting and macro definitions. Threading is made a whole lot easier, because a only a string has to be passed and gets expanded into the needed set of parameters in each thread

  - io functions and playback adapted to SignalManager

  - Introduction of SignalManager class for multiple channel management

- 0.29.5 [1998-04]

  - Just a fix for an annoying bug while zooming out

- 0.29.4 [1998-03]

  - removed a memory leak in playback

  - triple-checked the missing Accelerators in the Menumanager. It seems to be a bug in qpopmenu, I'll wait for qt to be fixed, or until a workaround is known

  - recent Files are updated again, while the program is running

  - kwave now keeps track of last directory saved to; for user convenience

  - reestablished selection mechanism to match versions before 0.29.3 and corrected some otherwise screwed-up behaviour

  - _now_ all parameters to destructors should have vanished

- 0.29.3 [1998-02]

  - developement has slowed down a bit, this release is not as complete as I wished but since 0.29.2 has a destructor with parameters accidently left in, and so does not compile on all systems -> here we go again...

  - reworked selection routines into a new class, code is still rather confusing, but seems to work

  - added checkmark functionality again

  - converted file-menus to new menu-scheme

  - added gui to mix channels together, the needed functions for mixing are still missing

  - Halt button by Gerhard Zintel

- 0.29.2

  - moved clipboard functionality to its own class

  - dynamic allocation of menu entries used by all classes but TopWidget

  - import of ascii data files

- 0.29.1

  - Bugfix for multichannel save. Now the saved files should work with other prgs

  - local snap to peak by Gerhard Zintel

- 0.29.0

  - changed version numbering and filename as suggested by Version 1.1 of "How To Name Things" from sunsite. The last digit will always mark be 0 for releases uploaded to ftp.kde.org.

  - added windowing (Hamming Hanning, Blackmann) functions

  - contribution from Gerhard Zintel displaying notes in fftview

  - Added pitch display window

  - implemented cursor and db scale for fft-view

  - added reselection and cursor change

  - added possibility of different display modes in Frequency representation

  - fixed severe quantisation bug in saving 16Bit routine, reported by ?

  - mmaping support contributed by Juhana Kouhia

  - added as new Possibility to generate Signals: pulse trains

  - added wrapper for systems with no posixthreads -> still needs handling by configure script (change Makefile for not linking libpthread and doing a define)

  - First use of multiple threads (pthreads) in some functions

  - Pitch generation now independent of additive synthesis

  - added import function for ascii files

  - Ascii label saving now also by frequency

  - Label generation according to Period Detection (autocorellation)

  - Sonagram, FFTView and Distortion-Dialog now use ScaleWidgets

  - New ScaleWidget gives the user more information

  - Improved ProgressDialog and Interpolation class to allow multiple threads

  - fixed some minor bugs

- 0.28 [1998-07-15]

  - changes in curvewidget (recent point has another pixmap).

  - sorting of labels now works without overwriting of QGList::compareItems.

  - bug fix for saving selection.

  - save Block function added.

  - signal finding function in markers.cpp: gui improved.

  - some smaller bug fixes.

- 0.27

  - first release, but never uploaded, because ftp.kde.org was down.

## Installation

### How to obtain &kapp;

&kapp; has an own homepage under http://kwave.sourceforge.net/. Here you can find further informations about the project, as well as informations about current stable and up-to-date development versions.

If you want to get a &kapp; release, you have the choice to visit http://kwave.sourceforge.net/download.html and

- download a binary package of the latest stable version, if there is one for your distribution,

- download a source RPM package of the latest stable version,

- compile on your own, from a .tar.gz archive with the source code of the latest stable version,

- compile on your own, from the latest SVN source.

Don't be afraid, compiling Kwave should be quite simple even if you are not a programmer. It just needs some developer packages to be installed.

### Requirements

In order to successfully use &kapp;, you need:

- a computer running Linux (&kapp; might also run under some other operating system, but we have never tested this, please let us know if you get it working under some other platform / operating system)

- working sound playback (not really required for using but what would you do with a sound editor if you can't hear the result of your work?)

- KDE-3.1 or higher (at least the libraries, if you are a gnome fan, you can also run &kapp; if the proper libs are installed).

- qt-3.1 or higher (normally comes with KDE3)

- id3lib-3.8.1 or higher (for ID3 tags)

- mad-0.15 or higher (for MP3 import)

- flac-1.1.0 higher

- about 32 MB memory for starting &kapp; (but this may vary depending on your platform and configuration)

For a more complete and up-to-date list, please consult the README file that is included in the source distribution or can be found here: "http://svn.sourceforge.net/viewvc/kwave/trunk/README?view=markup". This file also contains some special hints for getting &kapp; running and/or building &kapp; under some distributions.

If you intend to compile &kapp; from the sources, you will need at least:

- cmake-2.4.6 or newer

- A C/C++ compiler. GCC-2.95.3 works fine, some older and any newer version (like gcc-4.1 and newer) work too.

- The glibc2 (libc-6) development environment. On SuSE systems the package is called "libc", on other systems it might be called "libc-devel".

- The KDE3 development environment: "kdelibs3-devel", "kdemultimedia3-devel", "kdesdk3".

- The Qt development environment, the package is normally called "qt3-devel" or similar.

- id3lib-devel-3.8.1 or higher

- mad-devel-0.15 or higher

- flac-devel-1.1.0 higher

- If you intend to get the &kapp; sources via SVN, you will also need a current subversion package.

- ...many other packages, please take a look at the "README" file included in the source package.

### Manual Compilation and installation

Since version 0.7.10 &kapp; uses cmake, the make system that is also used by KDE itself. So if you can build other KDE applications, you should also be able to build &kapp;. If you run into problems please report them to the &kapp; mailing list.

In order to compile and install &kapp; on your system, it is best practice to do a out-of-tree build. This means that you hold the sources of &kapp; in one directory and build the package in another (temporary) directory.

For example, assuming that your sources are already unpacked in ``$HOME/src/kwave-0.7.11``, you can do the following:

    % mkdir /tmp/kwave-build
    % cd /tmp/kwave-build
    % cmake $HOME/src/kwave-0.7.11 [build options]
    % make
    % su root -c "make install"

(Specifying build options is a way to enable or disable specific features. See the following section for descriptions)

### Build options

By specifying build options, you can enable or disable some features of &kapp;, like excluding some components or plugins from the generated package. Here is a list of the available options:

- `WITH_ALSA` enable playback/recording via ALSA [`on`/`off`, default=`on`]

- `WITH_ARTS` enable playback via aRts [`on`/`off`, default=`off`]

- `WITH_BUILTIN_LIBAUDIOFILE` force usage builtin libaudiofile, even if the one installed in the system is useable [`on`/`off`, default=`off`]

- `WITH_DOC` build online documentation [`on`/`off`, default=`on`]

- `WITH_FLAC` enable support for FLAC files [`on`/`off`, default=`on`]

- `WITH_MP3` enable support for mp3 files [`on`/`off`, default=`on`]

- `WITH_OGG` enable support for ogg files [`on`/`off`, default=`on`]

- `WITH_OSS` enable playback/recording via OSS [`on`/`off`, default=`on`]

These options can be passed to ``cmake`` with ``-D``option``=``value``. For example, if you want to leave out generation of the online documentation, you can pass the corresponding option as follows:

    % cmake [source directory] -DWITH_DOC=off [other options...]

### Building RPM packages from tar.gz archives

#### With working rpmbuild -ta

If you are runnig a system with RPM support, the preferred way to install &kapp; on your system will be the creation of a nice RPM package. First you should get the current source of &kapp;, either as a tar.gz archive from the &kapp; download page or check out an up-to-date copy via SVN (like described in the chapter about SVN) and read the next chapter.

If you have downloaded a tar.gz archives of &kapp;, create and install the RPMs just by doing the following steps (where `[arch]` stands for the platform you have built the package and might be something like `i386`, `i586`, `sparc` or whatever, `XXX` stands for the version number you have downloaded).

To build the &kapp; package and install it do:

    % rpmbuild -ta kwave-XXX.tar.gz
    % rpm -i /usr/src/redhat/RPMS/[arch]/kwave-XXX.[arch].rpm

Note for SuSE users: you have to specify the directory `/usr/src/packages` instead of `/usr/src/redhat` !

If you haven't seen any errors, then that's it and you can skip the rest of this chapter. If rpm was unable to build the packages and says something like "spec file not found", then go on and read the rest of this section.

#### With broken rpmbuild -ta support

If you can't get `rpmbuild -ta` working, here are the steps for making that manually (the hard way):

1. Go to your RPM "topdir". This normally is `/usr/src/redhat` for the redhat distribution or `/usr/src/packages` if you have the SuSE distribution.

       % cd /usr/src/redhat

2. Put the tar.gz archive into the SOURCES subdirectory (you have to replace "somewhere" with the real directory where the files are, of course).

       % cp /somewhere/kwave-XXX.tar.gz SOURCES

3. Extract the spec file from the archives and put it into the SPEC subdirectory.

       % tar -xOzf SOURCES/kwave-XXX.tar.gz \*.spec > SPECS/kwave.spec

4. Let rpm do the compile job and generate the rpm of &kapp;. If you only want to make a binary package, you can specify `-bb` instead of `-ba`, or just `-bs` to build only a source package.

       % rpmbuild -ba SPECS/kwave.spec

5. If everything was ok, you can install the binary rpm of &kapp;, it will be in the BUILD directory. If you already have a version of &kapp; installed, please remove it first or use the parameter `-U` instead of `-i` for upgrading instead of installing.

       % rpm -ivh BUILD/[arch]/kwave-XXX.[arch].rpm

### Building RPM packages from SVN

#### Checking out the sources

For initially checking out the sources you will need some disk space (about 25 megabytes) in a directory of your choice, the svn package of your favorite distribution and full access to the internet. If you get error messages about rejected connections you either have typed something wrong or your provider doesn't give you full access. A good place for the source files will be `"$HOME/src"`.

1. First create the directory that will receive the subdirectoy with &kapp; sources and change into it:

       % mkdir -p $HOME/src
       % cd $HOME/src

2. Then check out the latest sources from the SVN server:

       % svn checkout https://kwave.svn.sourceforge.net/svnroot/kwave/trunk kwave

   or you can check out a specific release with the following command:

       % svn checkout https://kwave.svn.sourceforge.net/svnroot/kwave/tags/[release-tag] kwave

   You can look up the names of the release tags in the web svn page at "http://svn.sourceforge.net/viewvc/kwave/tags/". The release tags are always built out of the word `Release-` and the version number of the release, with underscores instead of dots. For example "`Release-0_7_9`" for v0.7.9.

There must not be a directory named `kwave` under the directory you want to check out. Otherwise the svn program will complain about already existing files and the checkout will not work.

#### Updating sources from SVN

The procedure described in the previous section is only necessary once. For further updates it is much easier. Just change into the directory where you have the checked out sources and do the following:

    % svn update

Then go on to the next section and compile as usual.

If you think that you have messed up your local source or if there are conflicts during updating, you can remove all files and directories from your &kapp; source directory, except the `.svn` directory and then try again.

#### Compiling

Building rpm package from a SVN snapshot is quite simple. The procedure is nearly the same as described in the last section, so it unhappily also has the same problem with the `rpmbuild -ta` command our method internally uses. Like in the previous chapter, `[arch]` stands for the platform you have Built the package and might be something like `i386`, `i586`, `sparc` or whatever, `XXX` stands for the version number you have checked out.

Note for SuSE users: here you have to specify the directory `/usr/src/packages` instead of `/usr/src/redhat` too!

Assuming that you are in the root of where you checked out from SVN, do the following to create a Makefile, the &kapp; package and install it. If you already have a version of &kapp; installed, please remove it first or use `rpm -U` instead of `rpm -i` for updating instead of installing.

    % mkdir /tmp/kwave-build
    % cd /tmp/kwave-build
    % cmake $HOME/src/kwave
    % make rpm
    % rpm -ivh /usr/src/redhat/BUILD/[arch]/kwave-XXX.[arch].rpm

If you still have problems with `make rpm`, you will find the tar.gz archive that was produced in `/tmp`. Please follow the instructions in the previous chapter.

### Relocating the binary RPM packages

The binary rpm package of &kapp; is "relocatable". That means that you can build the package on a system with any KDE3 directory and install it on an other system and/or into a different directory. This feature is very useful to install a package compiled for SuSE under a RedHat system or vice-versa.

For example: you got the binary rpm from a friend who has a RedHat system (where the KDE3 directory is `/usr`) and want to install it on a SuSE system (where the KDE3 directory is `/opt/kde3`). Then just give a different prefix when installing the rpm. Example:

    % rpm -ivh --prefix=/opt/kde3 kwave-0.7.11.i586.rpm

This modifies the path where the program is installed and it is strongly recommended that this is a directory that is contained in the KDEDIRS environment variable, or the directory that the shell command `kde-config --prefix` returns. Otherwise &kapp; would be unable to find it's menu configuration, plugins, preset files and so on...

### Building CPU optimized packages

If you are owner of a Pentium, an AMD K6, Athlon or Athlon-XP CPU, you might want to use compiler optimizations to compile your version of &kapp; that is running some percents faster. The gain in speed will be up to 30% on some systems, whereas the functions dealing with signal manipulation and all functions that do complex time-frequency operations (like FFT and Sonagram) will profit most from it.

You do not need to understand much about programming for using an optimized compiler to compile &kapp;, but maybe you will need some time to get the compiler itself working and installed.

#### RPM optimizations

You can easily compile the RPM package optimized for Athlon, Athlon-XP, Pentium and Pentium Pro (and some other CPUs) by using some defines in your `rpmrc` file. You can either modify your system's `rpmrc` file in `/usr/lib/rpm` or the `.rpmrc` file in your home directory. There you can specify option lines like these:

    optflags: i586 -O2 -march=pentium -DNDEBUG -fomit-frame-pointer
    optflags: i686 -O2 -march=pentiumpro -DNDEBUG -fomit-frame-pointer
    optflags: athlon -O2 -march=athlon -DNDEBUG -fomit-frame-pointer
    optflags: k6 -O3 -march=k6 -DNDEBUG -fomit-frame-pointer
    optflags: k7 -O3 -march=athlon-xp -DNDEBUG -fomit-frame-pointer

(I found those nice tricks at http://www.keywarrior.net/duesti/rpmopt.en.html. Thanks to Matthias Düsterhöft!).

This means that on an `k7` architecture the rpm package will be compiled using `-O3 -march=athlon-xp -DNDEBUG -fomit-frame-pointer` as compiler option and so on, you might extend or adapt these to your own needs. The settings apply to all of the sections before in all places where `rpmbuild -ta` is used or where a binary RPM is to be created out of a source rpm using `rpmbuild --rebuild`.

If `rpm` refuses to install your package because it seems not to fit to your computer's architecture, you can normally just install an optimized package by specifying the additional parameter `--ignorearch` and don't care.

#### How to pass optimizer options to the compiler manually

The invocation of the compiler is quite simple. It normally is sufficient to set the environment variables `CFLAGS` and `CXXFLAGS` in the correct way and then compile as usual. For the best settings please consult the documentation or homepage of the corresponding compiler.

If you build &kapp; from a source tree (unpacked tar.gz or from SVN) the flags need to be specidied before the call. For example:

    % CFLAGS="-O4 -march=athlon-xp -mcpu=athlon-xp -pipe -fomit-frame-pointer" \
      CXXFLAGS="-O4 -march=athlon-xp -mcpu=athlon-xp -pipe -fomit-frame-pointer" \
      cmake [source directory]

If you re-build &kapp; from a source rpm package, please follow the instruction in the previous section.

## Basics about digital audio

This chapter should give a short introduction about the basics of digital audio processing, without going too much into details. Of course this might be a bit incomplete, but if you have questions, you can ask at the &kapp; mailing list or consult some further literature.

### The analogue world

First of all, one must know that the world is analogue - but computers work digitally. So there are several ways to convert analogue audio to digital audio and back again. As the way from digital to analogue normally is the reversion of the way from analogue to digital, we only describe the way from analogue to digital.

Conversion from sound to bits

Conversion from sound to bits

Before continuing, analogue audio has to be transformed into electronic signals in order to find it's way into a computer. One common way to do this is by using a microphone and an amplifier. This combination gets sound (changes of air pressure) at it's input and a voltage at it's output. Higher amplitude of the pressure changes will be represented by higher voltages at the amplifier's output. This output is also called a 'signal'. Instead of a microphone you can of course also imagine other sources of audio. And the "amplifier" can be the one that is integrated into your sound card, where you normally can't see it.

Conversion to electronic signal

Conversion to electronic signal

At this stage, the electrical signal has three limitations that one should keep in mind:

1. The amplitude (volume) is limited to some maximum level. This is a consequence of the electronic (amplifiers) that are only able to handle voltages within some specific range. That's no problem as long as sounds are not too loud. In that case the signal would be clipped, which means that the electrical signal will run against it's margins and the result will be disturbed.

2. The frequency range is also limited. Due to the mechanical constrains of microphones and the limited frequency range of amplifiers, a signal's frequency range is limited. There are no hard borders besides which the sound abruptely disappears, but below some low and above some higher frequency the amplitude of the signal starts to decrease more and more. The existance of a maximum frequency can be easily understood as a limited speed of the electrical signal to rise and fall. By using high quality amplifiers and microphones, the limits can be spread into ranges where the human ear is no longer able to hear their results and thus get out of interest. The human ear normally is not able to hear sound above 20 kHz.

3. The signal contains noise. Noise is the most ugly enemy of everyone who has to handle audio signals in any way. Noise is a typical analogue effect, that makes the audio signal "unsharp" and disturbed, it is always present and cannot be avoided. One can only try to use high quality components that produce as low noise as possible, so that one can't hear it. Normally noise has a certain volume, so that the interesting sound should be much louder in comparism to the noise. This is called the signal to noise ratio (SNR), the higher it is the better the sound's quality will be. Sounds that have lower volume than the noise cannot be heart.

### Digitalization

When we want to store and play audio in a computer, we must convert the analogue sound into digital data first. This process is called digitalization. It converts an electronic signal into a sequence of digital values.

Digitalization of the electronic signal

Digitalization of the electronic signal

The conversion can be understood as a repetitive measurement of the electonic signal's value at certain time, thus taking a sample of the signal. The result is then encoded as a digital value.

The sampling could be done in arbitrary distances or in constant intervals. The later method is much easier to handle, and thus it is normally used, with a constant rate - the so-called sample rate. Usual sample rates are 8000, 11025, 22050, and 44100 samples per second. In practice sample rates are also given as frequencies, in Hz or kHz.

The sample rate limts the highest frequency a digitized signal can represent. Due to Shannon's theoreme the highest usable frequency is half of the sample rate, so with 44.1 kHz sample rate you cannot sample signals with more than 22 kHz. To avoid a violation of that half-sample rate rule, your soundcard already has built-in filters that filter away frequencies that are higher than half of the used sample rate.

Sampled signal

Sampled signal

### Sample Encoding

The result of the digital sampling process is a sequence of single samples. One sample is a digital representation of a signal's value at a certain time.

The value of a sample can be interpreted and encoded in several ways. The simplest one is linear encoding. This means that each sample's value directly represents the analogue signal's value multiplied with a constant factor. This is easy to handle, but has the disadvantage that noise will be audibles especially on low amplitudes, where it disturbes most, and less audible on high amplitudes, where it is less audible.

One way to reduce the influence of noise is non-linear encoding. This means that lower amplitudes are amplified before processing. As lower amplitudes are amplified, their distance from noise increases and the quality improves. The most common methods for this are A-Law and U-Law encoding - some standardized logarithmic amplification curves, used in digital telephony (ITU G.711 standard).

Nonlinear Encoding

Nonlinear Encoding

### Sample Formats

Samples can be stored in different formats and precisions. The most common ones are integer (fixed-point) formats, that store values with fixed quantisations. Depending on where the zero line is defined, it has to be destinguished between unsigned (only positive values, "zero line" is at half of the numeric range) and signed (positive and negative values) integer formats.

Signed Format

Signed Format

Unsigned Format

Unsigned Format

As the quantisation loses some accuracy, it produces noise, the so-called quantisation noise. That kind of noise has more effect on low amplitudes, so this method of storing samples is not optimal, but quite easy and very fast to handle (computers are fast in calculating with fixed point numbers).

The second way of encoding samples is with floating point numbers. With floating point numbers, noise is spread nearly equal over all ranges of amplitudes and has advantages especially on low ampliudes. However, this format is much slower when used for processing (computers are much slower on calculating with floating point values in comparison to fixed point numbers).

&kapp; internally uses signed integer format with 24 bit precision, stored in 32 bit integers. This has the disadvantage of higher memory consumption when processing files with lower precision (e.g. 8 bits), but processing 32 bit numbers is very fast and also leaves some reserves for internal calculations, as only 24 bits are normally used.

## Using &kapp;

Here is a little screenshot of the &kapp; main window, so that you get an impression what &kapp; looks like...

Here's a screenshot of &kapp; Screenshot of the Main Window

### Memory Setup

When using &kapp; for the first time, you should go to the memory setup dialog an modify the settings to be suitable for yor needs and the installed memory of your computer. You can reach it under Options Memory... .

Here's a screenshot of &kapp;'s memory setup dialog Screenshot of the Memory Setup Dialog

&kapp; is able to use two types of memory: physical and virtual memory.

Physical memory is the memory (RAM) that is installed in your computer. You should limit the usage of physical memory to some reasonable size, as a rule of thumb, half of the installed memory should be ok. If you set the limit too high, Linux will take memory from other applications, which means that it swaps out memory of other programs to the harddisk (swap), which is rather slow. If you set the limit too low, you might lose some performance when working with big files, because you use less of the fast physical memory than you could.

If you enable virtual memory, &kapp; is able to load and process files that are bigger than the amount of real installed physical memory. &kapp; does this by using temporary files in a configurable directory, which is much faster and more cooperative to other applications than using the operating system's swapping. The directory that you configure should be on your local hard disk.

### Command Line

If you start &kapp; from the command line, you can specify a list of files that should be opened. The first specified file will be opened first, then the other files. Each file will be opened in an own new window of the same &kapp; instance. If you specify wildcards, you can open a large number of files at once.

For example, the following command starts a &kapp; and opens all sounds of the KDE window manager, each in a new window:

    % kwave /opt/kde3/share/sounds/KDE_Window*.wav

In addition to a list of files, you can specify a list of Xt toolkit options like `-geometry` for specifying the size and/or position of the first opened &kapp; window and or `-display` for starting the &kapp; on a different display.

For example, the following command starts a &kapp; window with an initial width of 600 pixels and a height of 400 pixels, with the right border positioned 30 pixels away from the right and 0 pixels away form the top of the screen.

    % kwave -geometry 600x400-30+0

### Opening and Saving files

Opening files with &kapp; works like in most other applications, you can

- specify a list of files on the command line when starting &kapp;,

- open an empty &kapp; window (for example with Ctrl W File New... ) and put a file into it via drag and drop, or you can

- open a file through the menu with Ctrl O File Open

- or one of the last recently opened files under File Open Recent

- save the current file with Ctrl S File Save ,

- save under a different name with Shift Ctrl S File Save As

- or only the current selection with File Save Selection

#### Supported File formats

&kapp; supports the following file formats:

- The favourite file format of &kapp; is (like you can guess from the name) `.wav`. This format is very common to other "operating systems" and also is commonly used within the KDE environment.

- The second format that &kapp; supports is "ASCII". You can export to ASCII, but currently not import from it (this is currently not implemented). Please be aware that storing in this format might produce very large files! The file format will be described below.

- `.mp3` and `.mp2` import is available through libmad for the MP3 decoding in combination with id3lib for decoding ID3 tags.

- Ogg/Vorbis (`*.ogg`) import and export. See http://www.xiph.org for details.

- Additionally &kapp; supports many other common formats through the audiofile plugin. You can import files like `*.au` and `*.snd` (NeXT,Sun Audio), `*.aiff` (Audio Interchange Format) and `*.sf` (Berkeley,IRCAM,Carl Sound Format).

#### Converting to and from .wav

The best way to work with formats other than those supported by &kapp; is to use an external converter program. A good set of tools for this is in the SoX package, they have also some nice documentation! (The original homepage is located at http://www.spies.com/Sox/.)

The plans for future include support for import and also export filters for more formats and maybe some filter that uses a user-defineable script with a call to an external filter, so that even formats not supported by `SoX` (like MP3) can be read and/or written.

#### Format of ASCII files

The ASCII format is quite useful for scientific and educational purposes. Due to it's simple format, you can either write simple files on your own with a text editor or you can use the output of an other application and convert it into ASCII. As the format is really simple, you should not have big problems in writing a converter and most scientific applications use to have some kind of their own ASCII format for export.

The format of an ASCII file is quite simple and has the following rules:

1. At the start of the file comes a block of properties, with one property per line.

2. Each property line starts with `##`.

3. After the properties comes a list of samples, with one sample per line. When using multiple channels, the samples are separated by commas.

4. Lines might end with a carriage return and/or a line feed character (so DOS files are supported too). But when saving, files will always be saved with line feed character as the end of the line.

5. Empty lines and characters after a `#` are treated as comments and are ignored.

6. Values can be are given in any format that the C library of your system is able to read and interprete as a floating point or integer number. But when saving, &kapp; will save as in signed integer format with a 24 bit range.

7. All values are expected to be in signed format. So if you import a file with only positive values, you will only see samples that are above the zero line.

8. When importing, values can be specified in any range, &kapp; always does a first pass over the file to get the highest absolute value and defines that value as "100%" before really reading in the file and scaling it.

9. Internally all values are stored with 24 bit precision (signed).

Here is an example of a simple ASCII file that represents a sine wave with eleven samples:

##### content of an ASCII file with a single sine wave

    ## 'rate'=44100
    ## 'tracks'=2
    ## 'bits'=16
    ## 'length'=11
    ## 'Date'='2007-04-22'
    ## 'Software'='Kwave-0.7.9 for KDE 3.5.5'
      5930496,   5930496 #            0
            0,   8388352 #            1
     -5930752,   5930496 #            2
     -8388608,         0 #            3
     -5930752,  -5930752 #            4
            0,  -8388608 #            5
      5930496,  -5930752 #            6
      8388352,         0 #            7
      5930496,   5930496 #            8
            0,   8388352 #            9
     -5930752,   5930496 #           10
    # EOF

### Creating a New File

You can create a new and empty file menu under File New... .

Here's a screenshot of &kapp;'s new file dialog Screenshot of the File New Dialog

You can select the sample rate, resolution in bits per sample and the number of tracks. Per default the file format will be ".wav", but it can still be changed at the time when the file is saved.

The length of the new signal can be set by time (hours, minutes, seconds) or by the number of samples. Additionally you can select it relative to the highest possible length, which is limited by the available memory and &kapp;'s internal limit (2 GB).

### Recording

&kapp; is able to record audio data from various sources, with all sample rates, sample formats and other modes that your sound hardware supports. Currently &kapp; records through the old OSS sound interface, and since v0.7.4 also the newer and more powerful ALSA interface that is the preferred choice for linux kernel 2.6.

The recording can be reached from the menu under File Record .

Here is a screenshot of the &kapp; record dialog, showing the first page with the recording controls during a running recording session. Like in most dialogs of &kapp; you can get some help or see tooltips on the controls.

Here's a screenshot of &kapp;'s record dialog Screenshot of the Record Dialog

Here you have the following controls:

- Pre-Record: If the pre-recording feature of &kapp; is enabled and the recording is startet, &kapp; records into an internal buffer which is some seconds long. If you press the Record ( record button ) button again, then the recording really starts, and also keeps the already pre-recorded data. This is useful for example if you want to record your favorite song from radio, but you recognize too late that the song has started. In this case you can still press the record button and get the start of the song from what &kapp; has already pre-recorded before, so that you will no longer miss a start.

- Record-Time: If the length of the recording should be limited to some time, you can activate this setting and select a time in hours, minutes, seconds for your recording. If this option is not enabled, the recording runns until you press the Stop ( stop button ) button.

- Record Trigger: If enabled, the recording starts only if the volume of the input goes over a certain limit, which can be defined from 0 to 100% of the highest possible input volume. This is useful if you do not want to record leading silence.

- The New ( new button ) button is active when the recording is not running or is finished, to discard the current file content and start again.

- The Stop ( stop button ) button is active when the recording or pre-recording is running or &kapp; is waiting for the trigger. If pressed, the current progress will be stopped.

- The Pause ( pause button ) button is active when the recording or pre-recording is running. The first time you press it, the rcording will be halted and the button starts blinking. When you press it again the button will stop blinking and recording will continue immediately, without waiting for a trigger.

- The Record ( record button ) button starts the recording and/or prerecording, depending on the features enabled above:

  1. If neither prerecording nor trigger level are used, the recording starts as soon as you press the record button.

  2. If prerecording is not used and a trigger level is set, the first press will let &kapp; wait for the trigger level to be reached. While waiting for a trigger, you can force the recording to start immediately by pressing the record button again, otherwise the recording will start automatically when the trigger level has been reached.

  3. If prerecording is enabled, the first press starts only the prerecording and the second press really starts the recording.

### Playback

Depending on the compilation options &kapp; is able to play sounds trough one of the following playback methods:

- OSS (Open Sound System): The oldest linux implementation, capable of mono and stereo output. Deprecated since linux kernel 2.6, but still wide spread. Might collide with aRts from KDE or other sound applications, only one application at a time can use OSS playback !

- ALSA (Advanced Linux Sound Architecture): Supercedes OSS, supports more features and more hardware. Might collide with aRts or other applications like OSS does, but has a plugin called "dmix" as a way out.

- aRts (Analog Realtime Synthesizer): The preferred way of doing playback in KDE, the sound server KDE uses itself. Multiple applications can play at the same time. It must be configured in the KDE control center.

Before trying to play sounds, you should take a look on the playback configuration dialog:

Here's a screenshot of &kapp;'s playback setup dialog Screenshot of the Playback Setup Dialog

Currently &kapp; supports only 8 and 16 bit playback, with mono or stereo output through the OSS and the aRts interface, but many also all modes your sound hardware supports through the ALSA interface.

If your sound file uses more or less channels than the playback allows, all channels will be mixed together during playback. For example if you have a file with three channels and you use stereo playback, the left channel will play channel 0 (upper) and half of channel 1 (middle), the right channel will play the half of channel 1 (middle) and channel 2 (lower).

For getting a smooth playback without interruptions, you should also set the buffer size to an appropriate value. If you encounter problems with interrupted playback, you should increase the buffer size here. But the bigger you set the buffer, the bigger is the latency between the audible sound and the display of the playback position in the signal display.

The playback settings dialog also provides a button for playing a simple test sound. You should hear a 440Hz tone that wanders over all speakers, from one to the next.

Once you have configured playback, you can use the playback controls of the &kapp; main window or through the Play menu or with keyboard shortcuts:

- P Play Start : Start playback of the current selection from it's beginning or the whole file from the current cursor position if nothing was selected. Play only once.

- Play Loop : Like before, but repeat in a loop.

- Space Play Pause : Pause the playback at the current position. Only available when the playback is running.

- Space Play Continue : Continue the playback from the position where it has been paused. Only available if the playback is paused.

- Esc Play Stop : Stop the playback, go back to the start of the selection.

### File Properties

&kapp; is able to handle several meta information that is stored within an audio file. It tries to import and export as much of these informations as possible. For example, if you import an MP3 file with ID3 tags, you can keep those informations when exporting to a Wave file. If &kapp; would lose meta information when saving, it shows a warning.

You can view and modify the meta information under Edit File Properties... . There you can also change things like sample format, resolution and compression.

Here's a screenshot of &kapp;'s file properties dialog Screenshot of the File Properties Dialog

### How to select

&kapp; allows you to select a continuous range of samples as well as any combination of channels (if you edit a multi-channel file). By selecting a range of samples (time scope) all following commands will be limited to that range and by de-selecting a channel it's content will not be changed.

#### Selecting channels

Selecting or de-selecting a channel is quite simple. Just click on the lamp symbol on the left side of the signal to toggle it's state:

green lamb a green lamb means "enabled", whereas

red lamb a red lamb means "disabled".

Note: If a channel is de-selected it will also not be audible for playback!

#### Selecting samples

If you select a range of samples in &kapp;, that range will be inclusive. That means that the first and the last selected sample both belong to the selection and will be used for the following actions. So even if you not selected a range but only a single sample, the selection will never be really "empty". So for example if you see no selected range, the "delete" function applies to that single sample.

The easiest way of selecting a range of samples is just to do that with mouse. It works like you are used from other applications: just press the left mouse button at the point you want to let the selection start and release the button where you want it to end.

If you want to adjust or move the selection's start or end, you can move the mouse cursor near to the start or the end of the selection until it changes from the standard arrow cursor into the left-right arrow cursor and then press the left mouse button and adjust.

You can also extend or shrink the selection to a specific point by holding down the shift button while klicking with the left mouse button. Depending on which border is nearer, the left or right border of the selection will be set to a new position.

There are also some functions available via the menu and of course some keyboard shortcuts:

- select the whole signal: Ctrl A Edit Selection All

- the currently visible area: V Edit Selection Visible

- the next block of samples, starting one sample after the end of the current selection and with the same length: Shift+ Edit Selection Next

  (Hint: use the "+" key from the numeric keypad!)

- the previous block of samples, ending one sample before the start of the current selection and with the same length: Shift- Edit Selection Previous

  (Hint: use the "-" key from the numeric keypad!)

- expand the selection to the start of the signal (first sample): Shift Home Edit Selection to start

- expand the selection to the end of the signal (last sample): Shift End Edit Selection to end

- remove any selection and select "nothing": N Edit Selection Nothing

### Clipboard

&kapp; unfortunately has to implement and use it's own clipboard. This is due to the lack of support for formats other than text and bitmaps in the KDE environment and might be solved in some future release.

However, this has some disadvantages. So if you want to exchange data between two &kapp; instances through the clipboard, you will find out that this is simply not possible. Each instance of &kapp; uses it's own clipboard and so that can't work.

So if you want to make use of the clipboard in &kapp;, you should only start one &kapp; instance and use multiple &kapp; windows. That's the way it works!

### Drag and Drop

&kapp; supports the KDE Drag and Drop protocol. This enables you to open files just by picking them up in a `konqueror` window or the Desktop and let them drop into a window of &kapp;.

Please note that if you drop a file into a &kapp; window that already contains an opened file, the currently opened file will be closed first and then the file you dropped will be opened in it. If you don't want that, you should open a new empty &kapp; window first.

You can also select a range of samples and drag or drop them into a &kapp; window. Per default the drag operation is done in move mode where the selected range is deleted from the original place and inserted at the drop position. By pressing the Ctrl key you can modify this and drag in copy mode instead.

## Developer's Guide to &kapp;

under construction

Sorry, this chapter is still to be written... At the moment the source code is nearly completely documented with tags suitable with the KDE documentation tools. We currently prefer using doxygen. Maybe some day we will spend some time for writing a tool that converts the doxygen output into something we can include into the docbook source (the source this page has been built of).

If you want to write a plugin, contribute something to this project (or maybe write the converter mentioned above), please feel free to contact one of the authors directly and / or subscribe to the &kapp; mailing list. Help is always welcome!

### Adding support for a new Language

1. make system:

   Edit the toplevel `CMakeLists.txt` and add a new entry to the list of languages. Look for the variable `KWAVE_LINGUAS` and add a line for the new language. Each entry consists of a pair with a language code and language name, like this: ``<code>``:``<name>``. Example:

       	fr:Francais

   The language code is a 2-letter code which is used for directories and filenames, as it is also used in KDE. The language name is used internally for the docbook online documentation and the online help only. For a list of available language codes and names, please refer to the documentation of the international standard ISO 639-2.

2. user interface:

   Go to the source directory of &kapp; (not the build directory), change into the subdirectory `po` and copy the file `kwave.pot` to the corresponding `.po` file of the language you want to add: `"`<code>`.po"`. After that you can translate the file using your favorite tool, like `kbabel`. Example:

       % cd $HOME/src/kwave
       % cd po
       % cp kwave.pot fr.po
       % kbabel fr.po

3. online help:

   This is similar to the procedure for the user interface, but requires some extra steps because the master file is in `docbook` format and the `.pot` template is a generated file. Go to the source directory of &kapp; (not the build directory), change into the subdirectory `doc` and create an empty `.po` file:

       % cd $HOME/src/kwave
       % cd doc
       % touch help_fr.po

   Then change your build directory (e.g. somewhere in `/tmp`), prepare for building and then generate the `.pot` template (you can safely ignore the error messages that come out at this stage). This themplate has to be copied to the `.po` file in the source directory of the online help. Example:

       % mkdir /tmp/kwave-build
       % cd /tmp/kwave-build
       % cmake $HOME/src/kwave
       % make doc
       % cp doc/help_en.pot $HOME/src/kwave/doc/help_fr.po

   Now you can translate the `.po` file, like above:

       % cd $HOME/src/kwave
       % cd doc
       % kbabel help_fr.po

4. screenshots:

   For the online documentation you also need screenshots that use the translated messages. This requires a built and installed &kapp; package, so you should follow the steps mentioned in the section about Manual Compilation and installation. Of course you must not pass the build option `WITH_DOC=no` or any other build option that removes functionality, otherwise you would not be able to get screenshots of components that you have disabled.

   For a list of screenshots you can look into one of the existing directories in the source tree, for example in `$HOME/doc/de`. All screenshots are in `.png` and should follow the KDE Documentation Screenshots Requirements. Here in short:

   - Window decoration: Plastik

   - Widget style: Plastik

   - Colors: KDE Default

   - Background: Flat color - Color must be white

   - Run X11 in 72dpi mode

   - Save the files in 8bpp

   - Try to keep the size of each file below 20kB

Useful links:

- RFC 3066 Tags for the Identification of Languages

- KDE Localization contains a lot of useful links for KDE translators.

- KBabel is the standard tool that helps you translating `.po` files.

- KDE Documentation Screenshots Requirements.

## Questions and Answers

What do I need to compile &kapp;?

Read in the chapter mentioned before. It compiles with gcc-2.95 and gcc-3.x as well.

Which sound cards does &kapp; support?

&kapp; does not need support for any special sound card. The sound card only has to be supported by your operating system and &kapp; uses it's interface to the operating system's sound driver through a OSS or ALSA interface. So &kapp; can play on any sound card that KDE is able to play on.

Why are some menu entries / features always disabled?

This is just because we decided that those actions are not working stable enough to present them to the normal user and therefore disabled them to avoid trouble. You will get access to them if they are tested and stable enough.

Why does &kapp; consume more memory than it can be expected from the size of the opened file?

The reason for this is that &kapp; internally stores all samples in 32-bit integers. This was easy to program, made the application faster and a bit more reliable. So if you load an 8-bit file with about one megabyte it will consume about four megabytes. Maybe we will change this somewhere in the future...

Which sound formats does &kapp; support?

&kapp; currently supports .wav files with 8, 16 and 24 bits per sample, with any number of channels (of course including mono and stereo). Additionally it can import all file types that libaudiofile supports and some other formats like Ogg/Vorbis and MP3 (read-only).

What if I have files with a format not supported by &kapp;?

If you have to work on an other format, you can convert it into .wav format. A good set of tools for this is in the SoX package, they have also some nice documentation!

I get errors when I want to do playback?

Maybe you have choosen a combination of playback rate and sample size that is not supported by your sound driver and / or sound hardware. Try playback with 8 bits per sample and mono first, this should always work. Then try to increase the bits per sample and stereo playback step by step. Note that some playback rates are not at all supported by some sound hardware.

The playback seems to do something but I hear nothing?

Maybe you have forgotten to increase the volume of the playback channel. &kapp; is not responsible for changing the playback volume.

Some files are played with half-speed?

Try choosing a different sound playback device.

The playback sometimes is disturbed and interrupted?

You should increase the size of the playback buffer to get a "smoother" playback (this also makes the playback control reacting a bit slower).

The playback does not stop if I immediately press the stop button?

The reason for this is that the sound driver already has received some playback data from &kapp; at the moment when you press the stop button. Decrease the size of the playback buffer and it should react faster (but makes interruptions more probable).

Is ALSA supported?

Yes, since v0.7.4 for playback and recording

What about playback with 18, 20, 24 or 32 bits per sample or more than two channels?

This is possible through the ALSA interface, since v0.7.4.

What about MP3 support?

Well, as long as there are patent issues, we support only MP3 import through the mad library. No export, sorry...

## Credits and License

&kapp;

Program copyright from 1998-2000 Martin Wilz mwilz@ernie.mi.uni-koeln.de

Program copyright since 2000 Thomas Eschenbacher thomas.eschenbacher@gmx.de

For a complete list of authors and licenses of all files, please see the `LICENSES` file, which is included in the sources. It is also available online at "http://svn.sourceforge.net/viewvc/kwave/trunk/LICENSES?view=markup".

Contributors / Authors:

- Thomas Eschenbacher thomas.eschenbacher@gmx.de

- Sven-Steffen Arndt ssa29@gmx.de (homepage, german translation)

- Ralf Waspe rwaspe@web.de (Help/About plugin)

- Gilles Caulier caulier.gilles@free.fr (i18n, french translations, splashscreen, beta tester)

- Dave Flogeras dflogera@nbnet.nb.ca (Notch Filter plugin)

- Rik Hemsley rik@kde.org (level meter)

Thanks to (in alphabetical order):

- Jorge Luis Arzola arzolacub@gmx.de (packaging for SuSE Linux)

- Matthias Düsterhöft duesti@gmx.de (for information about RPM optimization)

- Michael Favreau michel.favreau@free.fr (packaging for Arch Linux)

- Aurelien Jarno aurel32@debian.org (debian packager)

- Martin Kuball makube@user.sourceforge.net (beta tester)

- my wife Ximena González (for her patience)

- T.H.F. Klok and Cedric Tefft (maintainers of the id3lib library)

- Robert Leslie rob@mars.org (author of the mad mp3 decoder library)

- Erik de Castro Lopo erikd@zip.com.au (author of the sndfile library)

- Michael Pruett mpruett@sgi.com (author of the audiofile library)

- Robert M. Stockmann stock@stokkie.net (packaging for Mandrake / X86_64)

- Diederick de Vries diederick76@gmail.com (packaging for Crux Linux)

Documentation copyright (C) 2006 Thomas Eschenbacher thomas.eschenbacher@gmx.de

Older code contained some FFT routines and code fragments from the GNU Scientific Library project http://sources.redhat.com/gsl/.

&underFDL; &underGPL;