Logo Search packages:      
Sourcecode: pulseaudio version File versions

pa_sample_format_t pa_parse_sample_format ( const char *  format  ) 

Parse a sample format text. Inverse of pa_sample_format_to_string()

Definition at line 195 of file sample.c.

References PA_SAMPLE_ALAW, PA_SAMPLE_FLOAT32BE, PA_SAMPLE_FLOAT32LE, PA_SAMPLE_FLOAT32NE, PA_SAMPLE_FLOAT32RE, PA_SAMPLE_S16BE, PA_SAMPLE_S16LE, PA_SAMPLE_S16NE, PA_SAMPLE_S16RE, PA_SAMPLE_S24_32BE, PA_SAMPLE_S24_32LE, PA_SAMPLE_S24_32NE, PA_SAMPLE_S24_32RE, PA_SAMPLE_S24BE, PA_SAMPLE_S24LE, PA_SAMPLE_S24NE, PA_SAMPLE_S24RE, PA_SAMPLE_S32BE, PA_SAMPLE_S32LE, PA_SAMPLE_S32NE, PA_SAMPLE_U8, and PA_SAMPLE_ULAW.

                                                              {
    pa_assert(format);

    if (strcasecmp(format, "s16le") == 0)
        return PA_SAMPLE_S16LE;
    else if (strcasecmp(format, "s16be") == 0)
        return PA_SAMPLE_S16BE;
    else if (strcasecmp(format, "s16ne") == 0 || strcasecmp(format, "s16") == 0 || strcasecmp(format, "16") == 0)
        return PA_SAMPLE_S16NE;
    else if (strcasecmp(format, "s16re") == 0)
        return PA_SAMPLE_S16RE;
    else if (strcasecmp(format, "u8") == 0 || strcasecmp(format, "8") == 0)
        return PA_SAMPLE_U8;
    else if (strcasecmp(format, "float32") == 0 || strcasecmp(format, "float32ne") == 0 || strcasecmp(format, "float") == 0)
        return PA_SAMPLE_FLOAT32NE;
    else if (strcasecmp(format, "float32re") == 0)
        return PA_SAMPLE_FLOAT32RE;
    else if (strcasecmp(format, "float32le") == 0)
        return PA_SAMPLE_FLOAT32LE;
    else if (strcasecmp(format, "float32be") == 0)
        return PA_SAMPLE_FLOAT32BE;
    else if (strcasecmp(format, "ulaw") == 0 || strcasecmp(format, "mulaw") == 0)
        return PA_SAMPLE_ULAW;
    else if (strcasecmp(format, "alaw") == 0)
        return PA_SAMPLE_ALAW;
    else if (strcasecmp(format, "s32le") == 0)
        return PA_SAMPLE_S32LE;
    else if (strcasecmp(format, "s32be") == 0)
        return PA_SAMPLE_S32BE;
    else if (strcasecmp(format, "s32ne") == 0 || strcasecmp(format, "s32") == 0 || strcasecmp(format, "32") == 0)
        return PA_SAMPLE_S32NE;
    else if (strcasecmp(format, "s32re") == 0)
        return PA_SAMPLE_S24RE;
    else if (strcasecmp(format, "s24le") == 0)
        return PA_SAMPLE_S24LE;
    else if (strcasecmp(format, "s24be") == 0)
        return PA_SAMPLE_S24BE;
    else if (strcasecmp(format, "s24ne") == 0 || strcasecmp(format, "s24") == 0 || strcasecmp(format, "24") == 0)
        return PA_SAMPLE_S24NE;
    else if (strcasecmp(format, "s24re") == 0)
        return PA_SAMPLE_S24RE;
    else if (strcasecmp(format, "s24-32le") == 0)
        return PA_SAMPLE_S24_32LE;
    else if (strcasecmp(format, "s24-32be") == 0)
        return PA_SAMPLE_S24_32BE;
    else if (strcasecmp(format, "s24-32ne") == 0 || strcasecmp(format, "s24-32") == 0)
        return PA_SAMPLE_S24_32NE;
    else if (strcasecmp(format, "s24-32re") == 0)
        return PA_SAMPLE_S24_32RE;

    return -1;
}


Generated by  Doxygen 1.6.0   Back to index