void mainProg3() throw(Error) { Endpoint ep; // Create library ep.libCreate(); // Init library EpConfig ep_cfg; ep.libInit( ep_cfg ); // Start library ep.libStart(); std::cout << "*** PJSUA2 STARTED ***" << std::endl; // Create player and recorder { AudioMediaPlayer amp; amp.createPlayer("../../tests/pjsua/wavs/input.16.wav"); AudioMediaRecorder amr; amr.createRecorder("recorder_test_output.wav"); amp.startTransmit(ep.audDevManager().getPlaybackDevMedia()); amp.startTransmit(amr); pj_thread_sleep(5000); } ep.libDestroy(); }
static void mainProg3(Endpoint &ep) throw(Error) { const char *paths[] = { "../../../../tests/pjsua/wavs/input.16.wav", "../../tests/pjsua/wavs/input.16.wav", "input.16.wav"}; unsigned i; const char *filename = NULL; // Init library EpConfig ep_cfg; ep.libInit( ep_cfg ); for (i=0; i<PJ_ARRAY_SIZE(paths); ++i) { if (pj_file_exists(paths[i])) { filename = paths[i]; break; } } if (!filename) { PJSUA2_RAISE_ERROR3(PJ_ENOTFOUND, "mainProg3()", "Could not locate input.16.wav"); } // Start library ep.libStart(); std::cout << "*** PJSUA2 STARTED ***" << std::endl; // Create player and recorder { AudioMediaPlayer amp; amp.createPlayer(filename); AudioMediaRecorder amr; amr.createRecorder("recorder_test_output.wav"); amp.startTransmit(ep.audDevManager().getPlaybackDevMedia()); amp.startTransmit(amr); pj_thread_sleep(5000); } }