From 163f5da3d8bfc662f3d7a967a98a01f063e05871 Mon Sep 17 00:00:00 2001 From: Christopher Rienzo Date: Fri, 19 Jun 2009 18:51:01 +0000 Subject: [PATCH] Add support for host byte ordered L16 from UniMRCP. We need UniMRCP r995 now git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13871 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c b/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c index c85de58d75..32cde79b3f 100644 --- a/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c +++ b/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c @@ -790,15 +790,18 @@ static switch_status_t speech_channel_open(speech_channel_t *schannel, const cha codec->channel_count = 1; codec->payload_type = 96; codec->sampling_rate = schannel->rate; - apt_string_set(&codec->name, schannel->codec); + if (!strcmp(schannel->codec, "L16")) { + /* "LPCM" is UniMRCP's name for L16 host byte ordered */ + apt_string_set(&codec->name, "LPCM"); + } else { + apt_string_set(&codec->name, schannel->codec); + } /* see RFC 1890 for payload types */ if (!strcmp(schannel->codec, "PCMU") && schannel->rate == 8000) { codec->payload_type = 0; } else if (!strcmp(schannel->codec, "PCMA") && schannel->rate == 8000) { codec->payload_type = 8; - } else if (!strcmp(schannel->codec, "L16") && schannel->rate == 44100) { - codec->payload_type = 11; - } + } switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) requesting codec %s/%d/%d\n", schannel->name, schannel->codec, codec->payload_type, codec->sampling_rate); if(schannel->type == SPEECH_CHANNEL_SYNTHESIZER) { termination = mrcp_application_sink_termination_create(schannel->unimrcp_session, &schannel->application->audio_stream_vtable, codec, schannel);