BWS Sample Class Documentation

Base class for any kind of samples (patterns for the different traits).

[DataContract(Namespace = "")]
public class Sample
    public Trait Trait { get; set; }
    public byte[] Data { get; set; }
    public string Tag { get; set; }


The Trait this sample belongs to.


The sample data itself. The data is represented by an array of bytes, which is typically simply a byte-stream containing an image- or wave-file.


An optional tag associated with this sample. The value of this tag is intended to be one or more strings (concatenated with a space), that describes some kind of demand or characteristics of the sample. The interpretation depends on the trait of the sample, the operation performed and the flags specified with the operation.

For example, face-samples used with the verify/identify/enroll operation using the LiveFaceDetection flag can specify the expected head movement direction relative to the preceding sample (up, down, left, right). In case you expect that the person in front of the camera moved his head horizontally you can set the tag "right left".

Supported Formats


Images can be sent in various formats including BMP, GIF, TIFF, JPEG and PNG files. Anyway, as it is common and reasonable to compress images that are sent over the internet, we highly recommend to use lossless compression mechanisms like PNG's Deflate algorithm. Some traits (like the face trait) also do not require to use color images, so sending grayscale images can reduce the amount of data even more.


We currently only support WAVE (a RIFF based waveform audio file format) files, PCM encoded with 8 or 16 Bits per sample (expected sample rate is 22.050 Hz), mono or stereo. The files must not contain any metadata chunks besides 'fmt' and 'data'. The files should contain relatively short passphrases with about one to two seconds in duration.