Ignore:
Timestamp:
Dec 22, 2006 3:24:11 PM (17 years ago)
Author:
bennylp
Message:

Ticket #46: added recording capability in streamutil sample application

File:
1 edited

Legend:

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

    r815 r856  
    5151 "  --play-file=WAV       Send audio from the WAV file instead of from  \n" 
    5252 "                        the sound device.                             \n" 
    53 // "  --record-file=WAV     Record incoming audio to WAV file instead of        \n" 
    54 // "                        playing it to sound device.                 \n" 
     53 "  --record-file=WAV     Record incoming audio to WAV file instead of  \n" 
     54 "                        playing it to sound device.                   \n" 
    5555 "  --send-recv           Set stream direction to bidirectional.        \n" 
    5656 "  --send-only           Set stream direction to send only             \n" 
     
    394394        } 
    395395 
    396  
     396        printf("Playing from WAV file %s..\n", play_file); 
     397 
     398    } else if (rec_file) { 
     399 
     400        status = pjmedia_wav_writer_port_create(pool, rec_file, 
     401                                                stream_port->info.clock_rate, 
     402                                                stream_port->info.channel_count, 
     403                                                stream_port->info.samples_per_frame, 
     404                                                stream_port->info.bits_per_sample, 
     405                                                0, 0, &rec_file_port); 
     406        if (status != PJ_SUCCESS) { 
     407            app_perror(THIS_FILE, "Unable to use file", status); 
     408            goto on_exit; 
     409        } 
     410 
     411        status = pjmedia_master_port_create(pool, stream_port, rec_file_port,  
     412                                            0, &master_port); 
     413        if (status != PJ_SUCCESS) { 
     414            app_perror(THIS_FILE, "Unable to create master port", status); 
     415            goto on_exit; 
     416        } 
     417 
     418        status = pjmedia_master_port_start(master_port); 
     419        if (status != PJ_SUCCESS) { 
     420            app_perror(THIS_FILE, "Error starting master port", status); 
     421            goto on_exit; 
     422        } 
     423 
     424        printf("Recording to WAV file %s..\n", rec_file); 
     425         
    397426    } else { 
    398427 
Note: See TracChangeset for help on using the changeset viewer.