diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-03-20 17:42:37 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-03-20 17:42:37 +0000 |
commit | d6203a1e7865a761624832100980c20fccb60277 (patch) | |
tree | 2f42397734243965df20e324b0e257b1fb8519c2 /pjsip-apps | |
parent | 7bc85671e50779d355c498ff2b20d8f577480214 (diff) |
Added clock-rate options in pjsua
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@343 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps')
-rw-r--r-- | pjsip-apps/src/samples/confsample.c | 70 |
1 files changed, 38 insertions, 32 deletions
diff --git a/pjsip-apps/src/samples/confsample.c b/pjsip-apps/src/samples/confsample.c index 11746e4b..514bd028 100644 --- a/pjsip-apps/src/samples/confsample.c +++ b/pjsip-apps/src/samples/confsample.c @@ -19,34 +19,33 @@ #include <pjmedia.h> -/* - * FILE: - * - * confsample.c - * - * PURPOSE: - * - * Demonstrate how to use conference bridge. - * - * USAGE: - * - * confsample [file1.wav] [file2.wav] ... - * - * where: - * fileN.wav are optional WAV files to be connected to the conference - * bridge. The WAV files MUST have single channel (mono) and 16 bit PCM - * samples. It can have arbitrary sampling rate. - * - * DESCRIPTION: - * - * Here we create a conference bridge, with at least one port (port zero - * is always created for the sound device). - * - * If WAV files are specified, the WAV file player ports will be connected - * to slot starting from number one in the bridge. The WAV files can have - * arbitrary sampling rate; the bridge will convert it to its clock rate. - * However, the files MUST have a single audio channel only (i.e. mono). - */ +static const char *desc = + " FILE: \n" + " \n" + " confsample.c \n" + " \n" + " PURPOSE: \n" + " \n" + " Demonstrate how to use conference bridge. \n" + " \n" + " USAGE: \n" + " \n" + " confsample [file1.wav] [file2.wav] ... \n" + " \n" + " where: \n" + " fileN.wav are optional WAV files to be connected to the conference \n" + " bridge. The WAV files MUST have single channel (mono) and 16 bit PCM \n" + " samples. It can have arbitrary sampling rate. \n" + " \n" + " DESCRIPTION: \n" + " \n" + " Here we create a conference bridge, with at least one port (port zero \n" + " is always created for the sound device). \n" + " \n" + " If WAV files are specified, the WAV file player ports will be connected \n" + " to slot starting from number one in the bridge. The WAV files can have \n" + " arbitrary sampling rate; the bridge will convert it to its clock rate. \n" + " However, the files MUST have a single audio channel only (i.e. mono). \n"; #include <pjmedia.h> #include <pjlib.h> @@ -58,6 +57,13 @@ /* For logging purpose. */ #define THIS_FILE "confsample.c" +/* Constants */ +#define CLOCK_RATE 44100 +#define NSAMPLES (CLOCK_RATE * 20 / 1000) +#define NCHANNELS 1 +#define NBITS 16 + + /* * Prototypes: */ @@ -173,10 +179,10 @@ int main(int argc, char *argv[]) */ status = pjmedia_conf_create( pool, /* pool to use */ port_count,/* number of ports */ - 16000, /* sampling rate */ - 1, /* # of channels. */ - 320, /* samples per frame */ - 16, /* bits per sample */ + CLOCK_RATE,/* sampling rate */ + NCHANNELS,/* # of channels. */ + NSAMPLES, /* samples per frame */ + NBITS, /* bits per sample */ 0, /* options */ &conf /* result */ ); |