On 3/18/08, Markus Vechiorno <finalpfc at hotmail.com> wrote: > > We can't, I'm afraid. Speex quality is initialized once during > > startup, and it applies for the whole library rather than on per call > > basis. You can, however, call pjmedia_codec_speex_init() and > > pjmedia_codec_speex_init_default() between calls to > modify the quality > > settings. Yes it's not pretty, but it's all the we've got now. > > > > Cheers, > > -benny > > Well, I am working in that, but I am wondering some things. > - If we are using the speex with quality 4 for example, and I want to > change the quality to 6, what should be the steps to make? > I am trying to do directly calling the pjmedia_codec_speex_init function to > change the quality, and then calling to update implemented in pjsua. Is it > right? (I think it is probably a mistake calling directly to speex_init > without doing some changes before). > > I have tried to do it with: > pjsua_var.media_cfg.quality = 10; > pjmedia_codec_speex_init(pjsua_var.med_endpt, > 0, > pjsua_var.media_cfg.quality, > pjsua_var.media_cfg.quality); > > But, then I try to see if any change has been done using 'd' and the dump > informations shows the same bitrate (the bitrate should change according to > the new quality, isn't it?) Yes it should. > What is wrong? > My guess is probably you missed calling pjmedia_codec_speex_deinit(). I tried adding a new menu command like below in pjsua, and it seems to work: case 'Q': if (!simple_input("Enter new speex quality:", buf, sizeof(buf))) break; pjmedia_codec_speex_deinit(); pjmedia_codec_speex_init(pjsua_get_pjmedia_endpt(), 0, my_atoi(buf), my_atoi(buf)); puts("Speex quality changed"); break; But just a bit of warning again, the snippet above most likely wouldn't work if there is a call with active media running in the application. cheers, -benny