Parse a sample format text. Inverse of pa_sample_format_to_string() Definition at line 166 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_S32BE, PA_SAMPLE_S32LE, PA_SAMPLE_S32NE, PA_SAMPLE_S32RE, 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_S32RE; return -1; }
|