de en sk
Home > Hobby Projects and Research > RKWAV - own Compressed Audio File Format

RKWAV - own Compressed Audio File Format

© Ing. Radovan Konečný - radkon, 2009-2012


Download the program:

download The compression algorithm is integrated in the program RadkonWave

About the project

RKWAV is a custom audio file format that uses lossless compression. The reason for its creation was the need to save disk and memory space, especially in my Sampler and in the Interactive music system INGENIA, where the conventional methods of audio compression cannot be used. Saving in storing samples (audio recordings) leads to an improvement of the instrument's performance - a larger part of the samples or more samples can fit in the computer's memory.

The RKWAV format meets the following requirements:

  • PCM format similar to WAV,
  • lossless compression,
  • extremely fast decompression and compression,
  • low computer memory requirements for both decompression and compression,
  • the possibility of a simple jump to any time-point,
  • simple saving of the decompression algorithm state to allow easy looping,
  • possibility to check the correctness of the data,
  • the ability to encrypt data.

RKWAV currently stores only 16-bit stereo or mono audio data. The length limit is 4 giga-samples (the WAV format is significantly worse - it has a length limit of 2 or 4 GB).

Compression algorithm

The audio recording is divided into small segments and the most suitable of the six compression methods is found for each segment. There are 6 extremely simple compression methods, where one of them is to store the samples without compression. In addition, the compression searches for the most advantageous size of the segments into which to divide the recording.

One of the compression methods is based on the more efficient storage of the relative jump in the sample value compared to the previous one. In audio recordings, there are places where this jump is small - either quieter places or places with a small proportion of high frequencies.

In addition, a checksum (CRC) is added to the RKWAV file to allow the file to be checked for corruption. The check can also be done, for example, in Sampler, which works with RKWAV files.

Results and comparison

Practical use of the RKWAV format has shown that it is advantageous to store audio data in this way for sampler-type audio programs. The sound data for the Sampler is usually a quarter to a half smaller.

If the RKWAV-file is additionally zipped, it is smaller than the zipped original WAV-file. This suggests that if a similar pre-processing of audio data were added to ZIP compression, this would significantly improve ZIP compression for audio data.

The following table shows the compression results for different types of sounds, plus in combination with ZIP compression:

Sound Compression ratio of RKWAV Compression ratio of ZIP Compression ratio of RKWAV + ZIP
piano samples (4.1 GB)
51.1%
38.4%
22.1%
bell samples (225 MB)
54.6%
49.8%
32.6%
harp samples (200 MB)
53.4%
45.3%
18.6%
Modelophone samples (197 MB)
66.4%
74.0%
48.4%
accordion samples (112 MB)
96.4%
95.6%
91.8%
music - my first CD (as one WAV)
79.8%
91.3%
74.9%
music - my second CD (as one WAV)
76.2%
90.1%
70.9%
music - song Sledgehammer (49 MB)
93.3%
92.4%
89.3%

Note: maximum compression (9) was selected for ZIP compression.

As can be seen from the table, in some cases RKWAV compression is much more efficient than ZIP compression, even though it is much less demanding for the computer.

Copyright © 2009-2025 Ing. Radovan Konečný - radkon. All rights reserved.