[asterisk-dev] capture and convert voice stream to a certain format

Kohler, Jeffrey J.Kohler at TechSmith.com
Wed Jul 5 06:04:58 MST 2006


I am also interested in capturing the live audio stream from a call.

 

The best place I've found to start is to modify the mixmonitor
application.  This lets you easily grab frames from a call.  Also, you
can grab both sides of the call muxed together or separately.

 

Asterisk has support for audio conversion between several formats (check
frame.h for supported formats).  There are two ways you could take
advantage of this:

-          Request a different format when setting up the channel spy
(spy.read_queue.format).  This only works if you're not bridging the two
sides of the call.

-          Do your own translation using the Asterisk translation stuff
(ast_translator_built_path, ast_translate...)

 

However, I'm not sure the Asterisk audio conversion stuff is going to be
of help to you.  By default the audio frames you'd get in mixmonitor
would be 16-bit signed linear 8KHz and I'm guessing little endian.  I
think you would need to perform the endianness conversion yourself.

 

Hope this helps

 

________________________________

From: asterisk-dev-bounces at lists.digium.com
[mailto:asterisk-dev-bounces at lists.digium.com] On Behalf Of Jamel A
Sent: Tuesday, July 04, 2006 5:44 AM
To: asterisk-dev at lists.digium.com
Subject: [asterisk-dev] capture and convert voice stream to a certain
format

 

Hello,

I have a program that analyse (in live mode) voice captured by the
microphone (8KHz, 16 bit, mono, signed, big endian).
I would like to analyse voice through Asterisk.
To test, I've modified the Echo function (located in the apps directory)
to grab voice frame, but I thing that firstly I must convert the data
right?

How can I do that?

Maybe, is there another solution? I know that we can record but I
suppose that we cannot read the file, wile being written...

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20060705/e296af67/attachment.htm


More information about the asterisk-dev mailing list