[pjsip] How To Create mem buffer WITH wav header

Benny Prijono bennylp at pjsip.org
Thu Nov 29 06:41:26 EST 2007

Thomas Plotkowiak wrote:
> Create a buffer:


Thanks for the tip! I hope others will find it useful.

> Theoretically I should be able now to play that buffer at the same time 
> with another soundengine. I am hearing the sound somehow but only if I 
> am lucky etc...
> So where might the problem be, is it because they are both accessing the 
> same buffer?

I think so. Also it might be because the sound callback thread from
PortAudio is running on real-time priority, so there might be
starvation issue.

What if you delay the playback (by other sound engine) by few
hundreds msecs? The easiest way to do would be to advance the
initial buffer write position by (msec * clock_rate / 1000).


> Cheers
> Thomas

More information about the pjsip mailing list