Ignore:
Timestamp:
Mar 24, 2006 8:44:27 PM (18 years ago)
Author:
bennylp
Message:

Added more samples: WAV recorder, resample, etc., and also moved some common functions to util.h

File:
1 edited

Legend:

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

    r350 r361  
    1919 
    2020#include <pjmedia.h> 
     21#include <pjlib-util.h> 
     22#include <pjlib.h> 
     23#include <stdio.h> 
     24#include <stdlib.h> 
     25 
     26#include "util.h" 
     27 
    2128 
    2229/* 
     
    3441 */ 
    3542 
    36 #include <pjmedia.h> 
    37 #include <pjlib.h> 
    38  
    39 #include <stdio.h> 
    4043 
    4144/* For logging purpose. */ 
     
    4346 
    4447 
    45 /* Util to display the error message for the specified error code  */ 
    46 static int app_perror( const char *sender, const char *title,  
    47                        pj_status_t status) 
    48 { 
    49     char errmsg[PJ_ERR_MSG_SIZE]; 
    50  
    51     pj_strerror(status, errmsg, sizeof(errmsg)); 
    52  
    53     printf("%s: %s [code=%d]\n", title, errmsg, status); 
    54     return 1; 
    55 } 
     48static const char *desc =  
     49" FILE                                                              \n" 
     50"                                                                   \n" 
     51"  playfile.c                                                       \n" 
     52"                                                                   \n" 
     53" PURPOSE                                                           \n" 
     54"                                                                   \n" 
     55"  Demonstrate how to play a WAV file.                              \n" 
     56"                                                                   \n" 
     57" USAGE                                                             \n" 
     58"                                                                   \n" 
     59"  playfile FILE.WAV                                                \n" 
     60"                                                                   \n" 
     61"  The WAV file could have mono or stereo channels with arbitrary   \n" 
     62"  sampling rate, but MUST contain uncompressed (i.e. 16bit) PCM.   \n"; 
    5663 
    5764 
     
    6976    pj_status_t status; 
    7077 
    71  
    72     /* Verify cmd line arguments. */ 
    73     if (argc != 2) { 
    74         puts(""); 
    75         puts("Usage: "); 
    76         puts("  playfile <wav-file>"); 
    77         puts(""); 
    78         puts("The WAV file could have mono or stereo channels with arbitrary"); 
    79         puts("sampling rate, but MUST contain uncompressed (i.e. 16bit) PCM."); 
    80         return 0; 
    81     } 
    8278 
    8379    /* Must init PJLIB first: */ 
Note: See TracChangeset for help on using the changeset viewer.