mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-07-12 02:03:39 +00:00
up
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13070 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
696bf57c1f
commit
dc1a0acdaa
@ -217,7 +217,7 @@ int vgo(int i, switch_core_session_t *session)
|
|||||||
int hangover = 40, hangunder = 15;
|
int hangover = 40, hangunder = 15;
|
||||||
int talking = 0;
|
int talking = 0;
|
||||||
int energy_level = 500;
|
int energy_level = 500;
|
||||||
|
int done = 0;
|
||||||
switch_core_session_get_read_impl(session, &read_impl);
|
switch_core_session_get_read_impl(session, &read_impl);
|
||||||
|
|
||||||
printf("%s", SWITCH_SEQ_CLEARSCR);
|
printf("%s", SWITCH_SEQ_CLEARSCR);
|
||||||
@ -245,15 +245,18 @@ int vgo(int i, switch_core_session_t *session)
|
|||||||
|
|
||||||
for (x = COLS - 1; ; --x) {
|
for (x = COLS - 1; ; --x) {
|
||||||
|
|
||||||
if (!switch_channel_ready(channel)) {
|
if (!done && !switch_channel_ready(channel)) {
|
||||||
break;
|
done = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!done) {
|
||||||
status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0);
|
status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0);
|
||||||
if (!SWITCH_READ_ACCEPTABLE(status)) {
|
if (!SWITCH_READ_ACCEPTABLE(status)) {
|
||||||
break;
|
done = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!done)
|
||||||
{
|
{
|
||||||
int16_t *fdata = (int16_t *) read_frame->data;
|
int16_t *fdata = (int16_t *) read_frame->data;
|
||||||
uint32_t samples = read_frame->datalen / sizeof(*fdata);
|
uint32_t samples = read_frame->datalen / sizeof(*fdata);
|
||||||
@ -261,6 +264,7 @@ int vgo(int i, switch_core_session_t *session)
|
|||||||
double energy = 0;
|
double energy = 0;
|
||||||
int divisor = 0;
|
int divisor = 0;
|
||||||
|
|
||||||
|
|
||||||
for (count = 0; count < samples; count++) {
|
for (count = 0; count < samples; count++) {
|
||||||
energy += abs(fdata[j]);
|
energy += abs(fdata[j]);
|
||||||
j += read_impl.number_of_channels;
|
j += read_impl.number_of_channels;
|
||||||
@ -296,12 +300,14 @@ int vgo(int i, switch_core_session_t *session)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!talking) {
|
if (!talking) {
|
||||||
x++;
|
x++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
usleep(20000);
|
||||||
|
}
|
||||||
|
|
||||||
if (LOGO == 0) {
|
if (LOGO == 0) {
|
||||||
if (add_D51(x) == ERR) break;
|
if (add_D51(x) == ERR) break;
|
||||||
@ -310,8 +316,6 @@ int vgo(int i, switch_core_session_t *session)
|
|||||||
}
|
}
|
||||||
refresh();
|
refresh();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (x == COLS / 4) {
|
if (x == COLS / 4) {
|
||||||
sleep(2);
|
sleep(2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user