Opening and Saving files

Opening files with Kwave works like in most other applications, you can

  • specify a list of files on the command line when starting Kwave,

  • open an empty Kwave window (for example with FileNew... (Ctrl+W) ) and put a file into it via drag and drop, or you can

  • open a file through the menu with FileOpen (Ctrl+O)

  • or one of the last recently opened files under FileOpen Recent

  • save the current file with FileSave (Ctrl+S),

  • save under a different name with FileSaveAs... (Shift+Ctrl+S)

  • save all areas that are separated by markers, each one to an own file, with FileSaveBlocks...

  • or only the current selection with FileSaveSelection...

Supported File formats

Kwave supports the following file formats:

  • The favourite file format of Kwave 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 Plasma™ environment.

  • The second format that Kwave supports is "ASCII". You can export to and also import from ASCII. 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 and lame for encoding.

  • Ogg/Vorbis (*.ogg) import and export. See for details.

  • FLAC (*.flac) import and export. See for details.

  • Additionally you can import file formats like *.8svx (Amiga IFF/8SVX Sound File Format), *.au (NeXT, Sun Audio), *.aiff (Audio Interchange Format), *.avr (Audio Visual Research File Format), *.caf (Core Audio Format), *.nist (NIST SPHERE Audio File Format), *.sf (Berkeley, IRCAM, Carl Sound Format), *.smp (Sample Vision Format), *.snd (NeXT, Sun Audio), *.voc (Creative Voice) and others through the audiofile plugin.

Converting to and from .wav

The best way to work with formats other than those supported by Kwave 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 plans for future include support for import and also export filters for more formats and maybe some filter that uses a user-definable script with a call to an external filter, so that even formats not supported by SoX 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 some 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 have to be given in signed integer format with a 24 bit range, which is the internal storage format of Kwave.

  7. Everything after a # (except property lines, see above) will be treated as comment and will be ignored. Empty lines will also be ignored.

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

Example 3.1. content of an ASCII file with a single sine wave

## 'rate'=44100
## 'tracks'=2
## 'bits'=16
## 'length'=11
## 'Date'='2013-11-09'
## 'Software'='Kwave-0.8.11 for KDE 4.11.3'
  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