diff --git a/src/mod/formats/mod_sndfile/mod_sndfile.c b/src/mod/formats/mod_sndfile/mod_sndfile.c index 698dece9f9..8cdad270d0 100644 --- a/src/mod/formats/mod_sndfile/mod_sndfile.c +++ b/src/mod/formats/mod_sndfile/mod_sndfile.c @@ -95,12 +95,9 @@ static switch_status_t sndfile_file_open(switch_file_handle_t *handle, const cha context->sfinfo.channels = handle->channels; context->sfinfo.samplerate = handle->samplerate; - if (handle->samplerate == 8000 || handle->samplerate == 16000) { + if (handle->samplerate == 8000 || handle->samplerate == 16000 || + handle->samplerate == 24000 || handle->samplerate == 32000 || handle->samplerate == 48000) { context->sfinfo.format |= SF_FORMAT_PCM_16; - } else if (handle->samplerate == 24000) { - context->sfinfo.format |= SF_FORMAT_PCM_24; - } else if (handle->samplerate == 32000) { - context->sfinfo.format |= SF_FORMAT_PCM_32; } sf_command(context->handle, SFC_FILE_TRUNCATE, &frames, sizeof(frames)); @@ -119,13 +116,17 @@ static switch_status_t sndfile_file_open(switch_file_handle_t *handle, const cha context->sfinfo.channels = 1; context->sfinfo.samplerate = 16000; } else if (!strcmp(ext, "r24")) { - context->sfinfo.format = SF_FORMAT_RAW | SF_FORMAT_PCM_24; + context->sfinfo.format = SF_FORMAT_RAW | SF_FORMAT_PCM_16; context->sfinfo.channels = 1; context->sfinfo.samplerate = 24000; } else if (!strcmp(ext, "r32")) { - context->sfinfo.format = SF_FORMAT_RAW | SF_FORMAT_PCM_32; + context->sfinfo.format = SF_FORMAT_RAW | SF_FORMAT_PCM_16; context->sfinfo.channels = 1; context->sfinfo.samplerate = 32000; + } else if (!strcmp(ext, "r48")) { + context->sfinfo.format = SF_FORMAT_RAW | SF_FORMAT_PCM_16; + context->sfinfo.channels = 1; + context->sfinfo.samplerate = 48000; } else if (!strcmp(ext, "gsm")) { context->sfinfo.format = SF_FORMAT_RAW | SF_FORMAT_GSM610; context->sfinfo.channels = 1;