提交 eaa28d3e authored 作者: Anthony Minessale's avatar Anthony Minessale

windows play file thing (please test mike)


git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2276 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 45f49ecc
...@@ -453,6 +453,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess ...@@ -453,6 +453,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
NULL, pool) == SWITCH_STATUS_SUCCESS) { NULL, pool) == SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Raw Codec Activated\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Raw Codec Activated\n");
write_frame.codec = &codec; write_frame.codec = &codec;
} else { } else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Raw Codec Activation Failed %s@%uhz %u channels %dms\n", switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Raw Codec Activation Failed %s@%uhz %u channels %dms\n",
...@@ -492,7 +493,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess ...@@ -492,7 +493,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
int do_speed = 1; int do_speed = 1;
int last_speed = -1; int last_speed = -1;
switch_event_t *event; switch_event_t *event;
if (input_callback || buf) { if (input_callback || buf) {
/* /*
dtmf handler function you can hook up to be executed when a digit is dialed during playback dtmf handler function you can hook up to be executed when a digit is dialed during playback
...@@ -590,10 +591,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess ...@@ -590,10 +591,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
write_frame.datalen = (uint32_t)(olen * 2); write_frame.datalen = (uint32_t)(olen * 2);
write_frame.samples = (uint32_t)olen; write_frame.samples = (uint32_t)olen;
#ifndef WIN32
#if __BYTE_ORDER == __BIG_ENDIAN #if __BYTE_ORDER == __BIG_ENDIAN
switch_swap_linear(write_frame.data, (int) write_frame.datalen / 2); switch_swap_linear(write_frame.data, (int) write_frame.datalen / 2);
#endif #endif
#endif
for (stream_id = 0; stream_id < switch_core_session_get_stream_count(session); stream_id++) { for (stream_id = 0; stream_id < switch_core_session_get_stream_count(session); stream_id++) {
status = switch_core_session_write_frame(session, &write_frame, -1, stream_id); status = switch_core_session_write_frame(session, &write_frame, -1, stream_id);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论