diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-03-24 20:44:27 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-03-24 20:44:27 +0000 |
commit | a82abf01b16983b97036a5e0e11e70d188970256 (patch) | |
tree | 91cbe4cc7412ac0fbf2338d47af42bfbca05152e /pjsip-apps/src/samples/playfile.c | |
parent | 4317d89db92d5d7766e5409cc3a9c1142796d1ed (diff) |
Added more samples: WAV recorder, resample, etc., and also moved some common functions to util.h
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@361 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps/src/samples/playfile.c')
-rw-r--r-- | pjsip-apps/src/samples/playfile.c | 48 |
1 files changed, 22 insertions, 26 deletions
diff --git a/pjsip-apps/src/samples/playfile.c b/pjsip-apps/src/samples/playfile.c index a703bc57..215ff415 100644 --- a/pjsip-apps/src/samples/playfile.c +++ b/pjsip-apps/src/samples/playfile.c @@ -18,6 +18,13 @@ */ #include <pjmedia.h> +#include <pjlib-util.h> +#include <pjlib.h> +#include <stdio.h> +#include <stdlib.h> + +#include "util.h" + /* * playfile.c @@ -33,26 +40,26 @@ * */ -#include <pjmedia.h> -#include <pjlib.h> - -#include <stdio.h> /* For logging purpose. */ #define THIS_FILE "playfile.c" -/* Util to display the error message for the specified error code */ -static int app_perror( const char *sender, const char *title, - pj_status_t status) -{ - char errmsg[PJ_ERR_MSG_SIZE]; - - pj_strerror(status, errmsg, sizeof(errmsg)); - - printf("%s: %s [code=%d]\n", title, errmsg, status); - return 1; -} +static const char *desc = +" FILE \n" +" \n" +" playfile.c \n" +" \n" +" PURPOSE \n" +" \n" +" Demonstrate how to play a WAV file. \n" +" \n" +" USAGE \n" +" \n" +" playfile FILE.WAV \n" +" \n" +" The WAV file could have mono or stereo channels with arbitrary \n" +" sampling rate, but MUST contain uncompressed (i.e. 16bit) PCM. \n"; /* @@ -69,17 +76,6 @@ int main(int argc, char *argv[]) pj_status_t status; - /* Verify cmd line arguments. */ - if (argc != 2) { - puts(""); - puts("Usage: "); - puts(" playfile <wav-file>"); - puts(""); - puts("The WAV file could have mono or stereo channels with arbitrary"); - puts("sampling rate, but MUST contain uncompressed (i.e. 16bit) PCM."); - return 0; - } - /* Must init PJLIB first: */ status = pj_init(); PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1); |