Dear nuno, This is a side hint, please bay attention to the dependencies required, because most of the dependencies required are not allowed in windows store and more than likely it will fail the certificate test. So take that into consideration before spending time and effort. Abdelrahman Salah Sent From My Note II On 26 Mar 2014 18:25, "Nuno Centeio" <nuno.r.centeio at gmail.com> wrote: > Hi guys, > > I'm trying to implement the Windows Audio Session API (WASAPI) in order to > make PJSip compliant with Windows Store apps. > > I think that I'm almost done but I can get the sound correctly (it's just > that!). > > Here is what I have: > > (pb_client is a IAudioRenderClient) > hr = strm->pb_client->GetBuffer(frame_to_render, &cur_pb_buf); > > pjmedia_frame frame; > void* destBuffer = > (void*)malloc(strm->bytes_per_frame*frame_to_render*sizeof(pj_uint16_t)); > /* PCM mode */ > frame.type = PJMEDIA_FRAME_TYPE_AUDIO; > frame.size = strm->bytes_per_frame; > frame.timestamp.u64 = strm->pb_timestamp.u64; > frame.bit_info = 0; > frame.buf = destBuffer; > > status = (*strm->pb_cb)(strm->user_data, &frame); > > /* Because PJSip will give me PCM 16 bits, 2 channels and WASAPI needs > IEEE Floating point 32-bits, 2 channels > */ > CAudioConverter* conv = new CAudioConverter(); > conv->ConvI16ToF32((BYTE*)destBuffer, cur_pb_buf, frame_to_render); > > /* Write to the device. */ > hr = strm->pb_client->ReleaseBuffer(frame_to_render, 0); > > While running I have the following prints: > 3/26/2014 4:00:01 PM V SIP - Underflow, buf_cnt=0, will generate > 1 frame > 3/26/2014 4:00:01 PM V SIP - Underflow, buf_cnt=0, will generate > 1 frame > 3/26/2014 4:00:01 PM V SIP - 698 samples reduced, buf_cnt=6092 > 3/26/2014 4:00:01 PM V SIP - Buffer size adjusted from 6790 to > 6092 (eff_cnt=5760) > 3/26/2014 4:00:01 PM V SIP - Underflow, buf_cnt=0, will generate > 1 frame > 3/26/2014 4:00:02 PM V SIP - 320 samples reduced, buf_cnt=6412 > 3/26/2014 4:00:02 PM V SIP - Buffer size adjusted from 6732 to > 6412 (eff_cnt=5760) > > Any hints on what I might be doing wrong? > > Thanks > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip at lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20140326/c003ef50/attachment-0001.html>