[pjsip] Using pjsua to create a mp3 stream

buldozer at aufbix.org buldozer at aufbix.org
Tue Feb 19 13:15:32 EST 2008


Regarding MP3 recording ... what I do, is to re-add the code to pjsua-lib,
which was there until mp3 writer was moved to the third-party folder. 
Just find


    if (file_format == FMT_WAV) {
	status = pjmedia_wav_writer_port_create(pool, path,
						pjsua_var.media_cfg.clock_rate,
						pjsua_var.mconf_cfg.channel_count,
						pjsua_var.mconf_cfg.samples_per_frame,
						pjsua_var.mconf_cfg.bits_per_sample,
						options, 0, &port);

in pjsua_media.c and add the following lines right after

    } else if (file_format == FMT_MP3) {
	status = pjmedia_mp3_writer_port_create(pjsua_var.pool, path,
						pjsua_var.media_cfg.clock_rate,
						pjsua_var.mconf_cfg.channel_count,
						pjsua_var.mconf_cfg.samples_per_frame,
						pjsua_var.mconf_cfg.bits_per_sample,
						enc_param, &port);

... and include mp3_writer.c and mp3_port.h to pjsua-lib project. This works
for any pjsua-lib based applications.


Greets, Toni

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.






More information about the pjsip mailing list