Index: app_jack.c =================================================================== --- app_jack.c (revision 274530) +++ app_jack.c (working copy) @@ -21,6 +21,7 @@ * \brief Jack Application * * \author Russell Bryant + * \author Fabio Torchetti * * This is an application to connect an Asterisk channel to an input * and output jack port so that the audio can be processed through @@ -39,6 +40,10 @@ resample ***/ +#include +#include +#include + #include "asterisk.h" ASTERISK_FILE_VERSION(__FILE__, "$Revision$") @@ -60,11 +65,19 @@ #define RESAMPLE_QUALITY 1 -#define RINGBUFFER_SIZE 16384 +/* The bigger the buffer size is, the more delay will be introduced */ +/* in the conversation. Make sure that you set the period of Jack to */ +/* multiples of 80 (which is 80*4=320 bytes => the frame size of */ +/* asterisk) for better performance and quality. */ +#define RINGBUFFER_SIZE 1280 +/* Asterisk core native rate is 8KHz */ +#define NATIVE_RATE 8000.0 + /*! \brief Common options between the Jack() app and JACK_HOOK() function */ #define COMMON_OPTIONS \ " s() - Connect to the specified jack server name.\n" \ +" r() - Size of the ringbuffer - multiples of 320 will make you happy.\n" \ " i() - Connect the output port that gets created to the specified\n" \ " jack input port.\n" \ " o() - Connect the input port that gets created to the specified\n" \ @@ -86,6 +99,17 @@ Connect to the specified jack server name +