FeatureSet method: readADC

FeatureSet method: readADC

Syntax: <feature set> readADC <feature> <filename> [optional flags]

Example: fs readADC ADC /tmp/file.adc -hm 512 -chX 2 -chN 2 -from 2.1s -to 3.2s -sr 16

A SVector feature with the name <feature> is created by reading the data from a file <filename>. This is usually an audio file with recorded speech.

In the example the 2nd channel of a stereo file /tmp/file.ad with a sampling rate of 16kHz is read. A 512 byte header is skipped and only a segment from 2.1 seconds to 3.2 seconds was loaded. The byte mode wasn't set but with the default "auto" the byte order is detected automatically. This is not recommended especially for short segments Optional flags:

-hm <header>
Header mode: <header> can be "CMU","KA","PHON" or "auto". In case of "auto" the file will be checked for any of the header formats mentioned. If none of them can be found 'no header' is assumed. If <header> is an integer <header> bytes will be skipped from the beginning of the file.
-bm <byte mode>
Byte modes for 16bit data: "10" most significant byte is the first byte, "01" most significant byte is the second byte or "auto" (automatic detection of byte order using a smoothness criterion).
Byte modes for 8bit data: "ulaw", "alaw" or "lin" for linear data. In the latter case the values are multiplied by 256 to use the full short range of the SVector feature.
-chN <channels>
Sets the number of channels of a file with multiplexed channels. That means the samples of the different channels are stored one after the other: the first sample of all channels then the second and so on. The desired channel can be selected with the -chX flag.
-chX <channel>
Select a channel (see -chN). Can be 1..<channels>. Default is 1.
-from <time>
Load samples starting from a certain time. If <time> is a number it indicates the sample number. In combination with flag '-sr' <time> can also be in seconds or milliseconds. With a sampling rate of 10kHz the following times are identical:
200 20m 20ms 0.02s 0.02sec
-to <time>
Load samples ending with <time> (inclusive) similar to '-from'. <time> can also be "last" (default).
-offset <value>
Due to recording conditions some audio files have an offset. In order to compensate this effect <value> will be subtracted from all samples. With <value> = "mean" an average over all (read!) samples will be used.
-fadeIn <time>
The first samples are multiplied with a value starting at 0 and increasing to 1 until <time> relative to the start of the read segment. <time> can be given in the time format.
-sr <sampling rate>
The sampling rate in kHz of the new feature. Without this flag the sampling rate will be taken from the header or is the standard sampling rate of the FeatureSet.
-startFile <filename>
Defines the start semaphore filename in the runon mode.
-readyFile <filename>
Defines the ready semaphore filename in the runon mode.
-sleep <time_in_sec>
How long to wait before checking again for the semaphore files or data file (runon mode).
Related commands: writeADC