Playing sounds dynamically

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

 



Hi,

I'm trying to play some sounds during the call based on user input.  I'm
using python bindings and the simple call application to try things out:
http://trac.pjsip.org/repos/wiki/Python_SIP/Hello_World

My code snippet is:

    call = acc.make_call(sys.argv[1], MyCallCallback())
    #wait for call to reach destination
    time_waited = 0;
    while call.info().state != pj.CallState.CONFIRMED:
        time.sleep(1);
        time_waited += 1;
        if time_waited > 60:
            break;

    #some checks for call state

    wav_player = lib.create_player(wav_file_name);
    lib.conf_connect(lib.player_get_slot(wav_player), call.info
().conf_slot);

However that code doesn't play anything.  If I create the player before
making the call and connect it to conf_slot it works.

My question is how can I play sounds dynamically?
Is wav player method the wrong approach?
I see there's a memory player example
http://trac.pjsip.org/repos/browser/pjproject/trunk/pjmedia/src/pjmedia/mem_player.c.
Is this the right way to go?
Are there bindings to do this in python?

Thanks guys.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20120829/86cb04bf/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