Logo Search packages:      
Sourcecode: pulseaudio version File versions  Download package

size_t pa_sample_size ( const pa_sample_spec spec  ) 

Return the size of a sample with the specific sample type

Definition at line 38 of file sample.c.

References pa_sample_spec::format, PA_SAMPLE_ALAW, PA_SAMPLE_FLOAT32BE, PA_SAMPLE_FLOAT32LE, PA_SAMPLE_MAX, PA_SAMPLE_S16BE, PA_SAMPLE_S16LE, PA_SAMPLE_S32BE, PA_SAMPLE_S32LE, PA_SAMPLE_U8, and PA_SAMPLE_ULAW.

                                                  {

    static const size_t table[] = {
        [PA_SAMPLE_U8] = 1,
        [PA_SAMPLE_ULAW] = 1,
        [PA_SAMPLE_ALAW] = 1,
        [PA_SAMPLE_S16LE] = 2,
        [PA_SAMPLE_S16BE] = 2,
        [PA_SAMPLE_FLOAT32LE] = 4,
        [PA_SAMPLE_FLOAT32BE] = 4,
        [PA_SAMPLE_S32LE] = 4,
        [PA_SAMPLE_S32BE] = 4,
    };

    pa_assert(spec);
    pa_assert(spec->format >= 0);
    pa_assert(spec->format < PA_SAMPLE_MAX);

    return table[spec->format];
}


Generated by  Doxygen 1.6.0   Back to index