wav_play and PUT/GET frame

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

 



Automatically => That the bridge does it.

what i currently do :

-  create a conf bridge
-  wait for an incoming call 
- accept a call (200OK)
- create a media_port with the audio stream
- add media_port to the conf bridge
- load a wav file, create a wav player port
- create a resample port
- add it to the bridge
- and do get/put frame

my code works but I think that's not the best way to do.
If i don't use get/put, the player doesn't read or play the file.

pj_int16_t samplebuf[MAX_FRAME];
    
    i = 1;
    while ( i < 50) { //50, enought for me
        pjmedia_frame frame;
        pj_status_t status;
  
        frame.buf = samplebuf;
        frame.size = sizeof(samplebuf);
  
        // Get the frame from wav player port.
        status = pjmedia_port_get_frame(resample, &frame);
        if (status != PJ_SUCCESS || frame.type == PJMEDIA_FRAME_TYPE_NONE) {
        // End-of-file, end the conversion.
        break;
        }
  
        // Put the frame to media stream port.
        status = pjmedia_port_put_frame(media_port, &frame);
        if (status != PJ_SUCCESS) {
        // Error in writing the file.
        break;
        }

printf("%d\n", i++);
    pj_thread_sleep(20);

    }

Date: Wed, 19 Jun 2013 19:55:30 +0700
From: onmyway133@xxxxxxxxx
To: pjsip at lists.pjsip.org
Subject: Re: wav_play and PUT/GET frame

What do you mean by "automatically" ?Conf bridge does get frame for you

On Wed, Jun 19, 2013 at 5:42 PM, P.a Masse <torwood at hotmail.fr> wrote:




Hi, 

It is possible to have a wav player with a conf bridge and not use PUT / GET frame manually? (do it automatically)


Thanks,
Best regards,
Pierre
 		 	   		  

_______________________________________________

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




-- 
Khoa PhamHCMC University of Sciencewww.fantageek.com




_______________________________________________
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/20130619/f6f759ce/attachment-0001.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