So how does the thing work if I use a microphone input instead of a wav file and transfer that to the mem_recorder? Would that include some wav header, or is there no possible solution to create a buffer that would be filled from pjsip and read from another application? I know my question might sound a little bit strange, asking why does he want to use another sound application on-top. But i want to do some 3D positioning of the sound, and thats only possible with a thirdparty application. Thx, for helping me out benny, cheers thomas 2007/11/8, Benny Prijono <bennylp at pjsip.org>: > > > You're guessing right. The memory based reader/writer's buffer > simply doesn't have WAV header, and that's all there is. > > cheers, > -benny > > > Thomas Plotkowiak wrote: > > I am trying to read in a mono wav file and put it into memory, in short. > > > > The things I am doing now in short are: > > > > 1. Allocate some buffer space > > /* Allocate some memmory for the buffer*/ > > int membuffer_size = 1024*8000; > > unsigned char *membuffer; > > membuffer = new unsigned char[membuffer_size]; > > > > 2. Init PJ LIb ... > > 3. Create a media port from the WAV file > > status = pjmedia_wav_player_port_create(.... &file_port...) > > > > 4. Create a memory capture port > > status = pjmedia_mem_capture_create (... > > membuffer,membuffer_size,..&mem_port...) > > > > 5. Create a conference bridge > > > > 6. Add the mem_port to the conference bridge > > status = pjmedia_conf_add_port( ... mem_port...) > > > > 7. Add the file_port to the conference bridge > > status = pjmedia_conf_add_port( ... file_port...) > > > > 8. Connect the fileport source (2) to memport (1) destination > > status = pjmedia_conf_connect_port(conf, 2, 1, 0); > > > > SO FAR everything works like expected. But now I am trying to read that > > memory buffer out with another application. > > > > BUT here the problem is i simply am not hearing any sound. I have > > checked that that the file_port is writing to the memory by > > > > status = pjmedia_mem_capture_get_size (mem_port); > > > > which shows an increase in size so a good guess that its not the > writing. > > > > MY Guess is that the wav in memory lacks a RIFF WAV header, I guess it > > is only created after i destroy the file_writer, because some > > calculations about the length of the wav file etc.. have to be made in > > the header. So my question is would it make sense to add a "dummy" > > header to make the wav file readable in "realtime"? or are there better > > ways? > > > > Here is the link to the Memory/Buffer Capture Port > > http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__MEM__CAPTURE.htm > > > > > > Cheers Thomas > > > > _______________________________________________ > 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/20071108/b2b32a7d/attachment.html