git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@104 d0543943-73ff-0310-b7d9-9358b9ac24b2

This commit is contained in:
Anthony Minessale
2005-12-10 01:14:49 +00:00
parent e59b65efa6
commit b4e75a2743
2 changed files with 22 additions and 17 deletions
+14 -14
View File
@@ -42,8 +42,8 @@ static const char modname[] = "mod_portaudio";
static switch_memory_pool *module_pool;
static int running = 1;
#define SAMPLE_TYPE paInt16
typedef short SAMPLE;
#define SAMPLE_TYPE paInt16
typedef short SAMPLE;
typedef enum {
TFLAG_IO = (1 << 0),
@@ -80,9 +80,9 @@ struct private_object {
unsigned char databuf[1024];
switch_core_session *session;
switch_caller_profile *caller_profile;
char call_id[50];
PaError err;
PABLIO_Stream *audio_in;
char call_id[50];
PaError err;
PABLIO_Stream *audio_in;
PABLIO_Stream *audio_out;
int indev;
int outdev;
@@ -189,8 +189,8 @@ static switch_status channel_on_hangup(switch_core_session *session)
switch_core_codec_destroy(&tech_pvt->read_codec);
switch_core_codec_destroy(&tech_pvt->write_codec);
CloseAudioStream(tech_pvt->audio_in);
CloseAudioStream(tech_pvt->audio_out);
CloseAudioStream(tech_pvt->audio_in);
CloseAudioStream(tech_pvt->audio_out);
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "%s CHANNEL HANGUP\n", switch_channel_get_name(channel));
@@ -328,13 +328,13 @@ static switch_status channel_read_frame(switch_core_session *session, switch_fra
tech_pvt = switch_core_session_get_private(session);
assert(tech_pvt != NULL);
if ((t = ReadAudioStream(tech_pvt->audio_in, tech_pvt->read_frame.data, tech_pvt->read_codec.implementation->samples_per_frame))) {
tech_pvt->read_frame.datalen = t * 2;
tech_pvt->read_frame.samples = t;
*frame = &tech_pvt->read_frame;
return SWITCH_STATUS_SUCCESS;
}
if ((t = ReadAudioStream(tech_pvt->audio_in, tech_pvt->read_frame.data, tech_pvt->read_codec.implementation->samples_per_frame))) {
tech_pvt->read_frame.datalen = t * 2;
tech_pvt->read_frame.samples = t;
*frame = &tech_pvt->read_frame;
return SWITCH_STATUS_SUCCESS;
}
return SWITCH_STATUS_FALSE;