Managing audio files with labels

1 Juillet 1998

Michel Dutat
dutat@lscp.ehess.fr

Abstract

Directions for use sig2wav.exe, wav2labs.exe, majlabs.exe programs (available in this directory).

1  Introduction

It is often necessary to mark points of regions of interest in a sound file. This allows, for example, to make measurements or to extract subparts from the sound file. Microsoft Windows wave file format allows to store, along with the sound signal, a cue list. This cue list consists of text labels associated to positions in a file. These labels can be edited (added or removed) with a sound file editor such as CoolEdit. It is sometime useful to use labels produced by an external program, or to make computations on labels' positions. We describe here tools that allow to export or import the cue list of a windows' wave sound file to/from an ASCII file. These tools are :

 
sig2wav :
Create an wave file from an audio file in raw format like the ones recorded in the laboratory. It can incorporate labels found in a text file to the cue list of the wave file.
wav2labs :
Extract the labels from an wave file and print them to the screen.
majlabs :
Update the cues information of an wave file with the labels of an ascii file.

2  Creation of wave files (sig2wav.exe)

This program translate an audio file in format usually known as pcm raw data to an windows pcm file with extension .wav. An example of pcm raw data is the audio file recorded in the laboratory with the au22dsk program. The usual extension of these files are .sig and their features are :

Type :
pcm raw without header,
Code :
16 bits, Little-Endien,
Freq :
16000 Hz.

The sig2wav.exe program can manage differents samples frequency and differents quantification. In addition it can translate some informations about text labels associated with position sample into their counterpart in the wav file. These informations must have recorded in an text file like that :

1099 3805 vowel 
5413 7061 Fricative
8000 single
8458 10486 plosive
11587 13700 sonorant
15012 16703 boring noise
...

In this example you can see two sorts of labels. In the two first lines you can see Cues range. A Cue range is a portion of signal delimited by two samples. On the third line there is a Cue point. It's only reference a sample. The name of the label can have space in it like the one on the last line. You execute this program from an ms-dos window with the following syntax :

sig2wav [-f nnn] [-q i] [-l label_file] audio_file
-f
Sample frequency which can be : 6000, 8000, 11025, 16000, 22050, 32000, 32075, 44100 and 48000. The default is 16000.
-q
Quantification chosen between 8 bits or 16 bits. The default is 16 bits.
-l
An text file which contains your labels.
audio_file
An audio file in pcm raw format.

If you don't specify the label_file with the -l option, the program try to find in the current directory a file with the same name of the audio_file but with .lbn extension. An wave file is created with .wav extension. Below are some example of utilisation :

1> sig2wav file.sig
2> sig2wav -f 8000 file.sig
3> sig2wav -l do.it file.pcm 

In the first example the frequency is 16000 Hz, the quantification is 16 bits and the program try to find the text file : file.lbn in the current directory. The second example is the same as above but the frequency is 8000 Hz. In the third the labels file is do.it.

Warning : If something go wrong, you must ensure that there isn't any blank line after the last label in your label file.

3  Extraction of labels from a wave file (wav2labs.exe)

The purpose of this program is to extract the labels of the cue list of an wave file. You execute it from a ms-dos window with the following syntax :

wav2labs file.wav

The output is display on the screen. You can save the output to a file with the redirection operator.

wav2labs file.wav > file.lbn

4  Update of the cue informations of an wave file (majlabs.exe)

When you apply an automatic segmentation on your audio file, you must correct some choices did by the program. To do that you must use an audio editor like CoolEdit. You can remove some cue range, add some one and modify some sample frontier. In addition you must correct the name of the labels. To avoid this last tedious operation the program majlabs.exe (mise-à-jour labels) can update the labels for you. You must have an text file with the list of labels in it, one by line like this :

vowel 
Fricative
single
plosive
sonorant
boring noise
...

For each cue range found in the wave file his name is replaced by the one found in the text file, in chronological order. The syntax of the command is :

majlabs wave_file

The text file which contains the labels name is found in the current directory and must have the same name of the wave_file but with .txt extension.

Be careful : When you work with CoolEdit on an wave file, you must close it before apply majlabs.exe to it. Otherwise there is a conflict access.


File translated from TEX by TTH, version 1.55.