Ignore:
Timestamp:
Mar 20, 2006 5:42:37 PM (18 years ago)
Author:
bennylp
Message:

Added clock-rate options in pjsua

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/samples/confsample.c

    r337 r343  
    2020#include <pjmedia.h> 
    2121 
    22 /* 
    23  * FILE: 
    24  * 
    25  *  confsample.c 
    26  * 
    27  * PURPOSE: 
    28  * 
    29  *  Demonstrate how to use conference bridge. 
    30  * 
    31  * USAGE: 
    32  * 
    33  *  confsample [file1.wav] [file2.wav] ... 
    34  * 
    35  * where: 
    36  *  fileN.wav are optional WAV files to be connected to the conference 
    37  *  bridge. The WAV files MUST have single channel (mono) and 16 bit PCM 
    38  *  samples. It can have arbitrary sampling rate. 
    39  * 
    40  * DESCRIPTION: 
    41  * 
    42  *  Here we create a conference bridge, with at least one port (port zero 
    43  *  is always created for the sound device). 
    44  * 
    45  *  If WAV files are specified, the WAV file player ports will be connected 
    46  *  to slot starting from number one in the bridge. The WAV files can have  
    47  *  arbitrary sampling rate; the bridge will convert it to its clock rate.  
    48  *  However, the files MUST have a single audio channel only (i.e. mono). 
    49  */ 
     22static const char *desc =  
     23 " FILE:                                                                    \n" 
     24 "                                                                          \n" 
     25 "  confsample.c                                                            \n" 
     26 "                                                                          \n" 
     27 " PURPOSE:                                                                 \n" 
     28 "                                                                          \n" 
     29 "  Demonstrate how to use conference bridge.                               \n" 
     30 "                                                                          \n" 
     31 " USAGE:                                                                   \n" 
     32 "                                                                          \n" 
     33 "  confsample [file1.wav] [file2.wav] ...                                  \n" 
     34 "                                                                          \n" 
     35 " where:                                                                   \n" 
     36 "  fileN.wav are optional WAV files to be connected to the conference      \n" 
     37 "  bridge. The WAV files MUST have single channel (mono) and 16 bit PCM    \n" 
     38 "  samples. It can have arbitrary sampling rate.                           \n" 
     39 "                                                                          \n" 
     40 " DESCRIPTION:                                                             \n" 
     41 "                                                                          \n" 
     42 "  Here we create a conference bridge, with at least one port (port zero   \n" 
     43 "  is always created for the sound device).                                \n" 
     44 "                                                                          \n" 
     45 "  If WAV files are specified, the WAV file player ports will be connected \n" 
     46 "  to slot starting from number one in the bridge. The WAV files can have  \n" 
     47 "  arbitrary sampling rate; the bridge will convert it to its clock rate.  \n" 
     48 "  However, the files MUST have a single audio channel only (i.e. mono).   \n"; 
    5049 
    5150#include <pjmedia.h> 
     
    5958#define THIS_FILE   "confsample.c" 
    6059 
     60/* Constants */ 
     61#define CLOCK_RATE      44100 
     62#define NSAMPLES        (CLOCK_RATE * 20 / 1000) 
     63#define NCHANNELS       1 
     64#define NBITS           16 
     65 
     66  
    6167/*  
    6268 * Prototypes:  
     
    174180    status = pjmedia_conf_create( pool,     /* pool to use          */ 
    175181                                  port_count,/* number of ports     */ 
    176                                   16000,    /* sampling rate        */ 
    177                                   1,        /* # of channels.       */ 
    178                                   320,      /* samples per frame    */ 
    179                                   16,       /* bits per sample      */ 
     182                                  CLOCK_RATE,/* sampling rate       */ 
     183                                  NCHANNELS,/* # of channels.       */ 
     184                                  NSAMPLES, /* samples per frame    */ 
     185                                  NBITS,    /* bits per sample      */ 
    180186                                  0,        /* options              */ 
    181187                                  &conf     /* result               */ 
Note: See TracChangeset for help on using the changeset viewer.