Sending my own audio frames

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I use pjmedia_port_info_init to create a player port. Something like  
this:

     pool = pjsua_pool_create("MyPlayerPool", 4000, 4000);
     pj_strdup2(pool, &base.info.name, "MyPlayer");

     base.get_frame = &file_get_frame_get;
     base.put_frame = &file_put_frame_get;
     base.on_destroy = &file_on_destroy_get;

     pjmedia_port_info_init(&base.info, &name, SIGNATURE,  
sampling_rate, channel_count, bits_per_sample, samples_per_frame);


This works well for playing files in a non-standard format that I need  
to support. You put your sample generation code in file_get_frame_get.

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Jan 9, 2009, at 9:24 AM, Rafael Maia wrote:

>
> Hi,
>
> i made a media player in DirectShow that captures PCM audio frames  
> from mp3 audio files.
>
> I need to send this audio frames to PJSIP. Can anyone help me?
>
> I have tried adding a passive_port to the conference bridge and it  
> did not worked.
>
> Now i am trying to use splitcomb. And i can send some noise.
>
> Here's a code sample:
>
> // 1? pjmedia_splitcom_create
> pj_status_t status = pjmedia_splitcomb_create(pool_vars,  
> nSamplesPerSec, nChannels, samplesPerFrame, wBitsPerSample, 0,  
> &p_splitcomb);
> // for each channel
> for(unsigned int i = 0; i < nChannels; i++)  {
>      unsigned int p_slot;
>      pjmedia_port* p_port;
>
>      // 2? pjmedia_splitcom_create_rev_channel
>      status = pjmedia_splitcomb_create_rev_channel(pool_vars,  
> p_splitcomb, i, 0, &p_port);
>
>      // 3? pjmedia_conf_add_port
>      status = pjmedia_conf_add_port(conference_bridge, pool_vars,  
> p_port, NULL, &p_slot);
> }
>
>
> And then, when i want to send an audio frame i do the following:
>
> pjmedia_port_put_frame(p_splitcomb, &frame);
>
>
>
> What is wrong with my code?
> Am i using splitcom correctly?
>
> Any help would be appreciated...
>
> Rafael Maia
>
>
> O jeito mais f?cil de manter a sua lista de amigos sempre em ordem!  
> Organize seus contatos!
> _______________________________________________
> 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/20090109/f77b0ebe/attachment.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux