Changes between Version 97 and Version 98 of FAQ


Ignore:
Timestamp:
Aug 13, 2010 11:56:21 AM (14 years ago)
Author:
nanang
Comment:

Fix broken links to pjmedia_port doc

Legend:

Unmodified
Added
Removed
Modified
  • FAQ

    v97 v98  
    436436=== How can I manipulate audio samples directly? === #audio-man 
    437437 
    438 In PJMEDIA, audio frames are sent back and forth between what is called [http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__PORT__CONCEPT.htm media port (pjmedia_port)]. So to be able to peek or manipulate audio frames, we need to implement our own media port. 
     438In PJMEDIA, audio frames are sent back and forth between what is called [http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__PORT.htm media port (pjmedia_port)]. So to be able to peek or manipulate audio frames, we need to implement our own media port. 
    439439 
    440440Implementing media port should be easy. Basically we just need to implement these: 
     
    450450  }; 
    451451}}} 
    452  1. Fill in the media port information to describe the media port (like, the name, clock rate, bits per sample, etc.). Use [http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__PORT__INTERFACE.htm#gb3259d2924c7a2243733391f6f8f0a9a pjmedia_port_info_init()] to initialize the port into. 
     452 1. Fill in the media port information to describe the media port (like, the name, clock rate, bits per sample, etc.). Use [http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__PORT.htm#gb3259d2924c7a2243733391f6f8f0a9a pjmedia_port_info_init()] to initialize the port into. 
    453453 1. Implement {{{get_frame()}}} callback (of the ''pjmedia_port'') if the media port is a source (that is, the media port feed audio frames to other media ports). 
    454454 1. Implement {{{put_frame()}}} callback (of the ''pjmedia_port'') if the media port is a sink (that is, other media ports may feed audio frames to our media port). 
     
    614614 
    615615Currently PJMEDIA lacks built-in tone detection routine. But if you you have the routine, it shouldn't be straightforward to integrate it to the framework: 
    616  1. First, you need to wrap your routine as [http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__PORT__CONCEPT.htm pjmedia_port] so that it can be plugged to the media framework. Your implementation would be similar to [http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__FILE__REC.htm WAV writer] media port ([source:pjproject/trunk/pjmedia/src/pjmedia/wav_writer.c pjmedia/wav_writer.c]), but instead of writing to WAV file, it would monitor the audio signal for tone and call some callback when a tone is detected. 
     616 1. First, you need to wrap your routine as [http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__PORT.htm pjmedia_port] so that it can be plugged to the media framework. Your implementation would be similar to [http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__FILE__REC.htm WAV writer] media port ([source:pjproject/trunk/pjmedia/src/pjmedia/wav_writer.c pjmedia/wav_writer.c]), but instead of writing to WAV file, it would monitor the audio signal for tone and call some callback when a tone is detected. 
    617617 1. Once you have the tone detector media port implementation, you can just add this media port to the conference bridge with [http://www.pjsip.org/pjsip/docs/html/group__PJSUA__LIB__MEDIA.htm#g833528c1019f4ab5c8fb216b4b5f788b pjsua_conf_add_port()], and connect the audio source to your tone detector. 
    618618