Hi,

On Thu, Dec 4, 2008 at 12:57 PM, Umut Simsekli <[EMAIL PROTECTED]> wrote:
> I am trying to get the raw audio data that comes from the network (i.e.
> speaker audio) before it goes to the speakers. My purpose is to update
> the audio buffer, then send it to the audio device. (Briefly I am trying
> to add sound effects to the original sound). Could anybody help me with
> this problem?

The best way is to implement your own media processing resource.
You may think of resources as a building blocks of media processing
flowgraph. For a simple example of media processing resource you
can look into MprMixer class. It's a resource with several inputs
and one output, which mix all incoming data and sends it to output.
All processing is done inside doProcessFrame() method, which
is called on every frame processing interval.

Controling of resource is one with "resource messages", as a good
example of this you can look into MprDelay class. MprMixer uses
old way messaging which is not recommended for new resources.
MprDelay have two public methods: startPlay() and stopPlay(),
which simply send appropriate messages to the supplied queue.
Messages are then processed in handleMessage() method.

The whole idea around this is to avoid blocking as much as possible
inside media processing thread. So, you should *not* do any
blocking operations inside doProcessFrame() and handleMessage()!
If you want to communicate with other threads, you should use
messages, as I described above.

This is fairly short introduction to media processing we do,
but I hope it helps. I hope I'll write a tutorial on this a bit later,
but don't wait for this.

-- 
Regards,
Alexander Chemeris.

SIPez LLC.
SIP VoIP, IM and Presence Consulting
http://www.SIPez.com
tel: +1 (617) 273-4000
_______________________________________________
sipxtapi-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipxtapi-dev/

Reply via email to