summaryrefslogtreecommitdiff
path: root/apps/app_speech_utils.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2007-07-11 16:19:00 +0000
committerJoshua Colp <jcolp@digium.com>2007-07-11 16:19:00 +0000
commitf8e605fe25980c6e2192696757cdbaee6113c0f4 (patch)
tree032315fb180c3cd05bc7d3413049896897d2b403 /apps/app_speech_utils.c
parentb314d6ee08b351955f579f01ca5eda1730ab8641 (diff)
Allow the native formats of a channel to influence the audio that is going to the engine. The best format will try to be chosen with an ultimate fallback to signed linear if possible.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@74570 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_speech_utils.c')
-rw-r--r--apps/app_speech_utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/app_speech_utils.c b/apps/app_speech_utils.c
index 422d6e74d..2df89ba4e 100644
--- a/apps/app_speech_utils.c
+++ b/apps/app_speech_utils.c
@@ -352,7 +352,7 @@ static int speech_create(struct ast_channel *chan, void *data)
u = ast_module_user_add(chan);
/* Request a speech object */
- speech = ast_speech_new(data, AST_FORMAT_SLINEAR);
+ speech = ast_speech_new(data, chan->nativeformats);
if (speech == NULL) {
/* Not available */
pbx_builtin_setvar_helper(chan, "ERROR", "1");
@@ -572,7 +572,7 @@ static int speech_background(struct ast_channel *chan, void *data)
oldreadformat = chan->readformat;
/* Change read format to be signed linear */
- if (ast_set_read_format(chan, AST_FORMAT_SLINEAR)) {
+ if (ast_set_read_format(chan, speech->format)) {
ast_module_user_remove(u);
return -1;
}