<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
 /* List Definitions */
 @list l0
        {mso-list-id:2083092831;
        mso-list-type:hybrid;
        mso-list-template-ids:-1939436028 596828850 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:21.0pt;
        mso-level-number-position:left;
        margin-left:21.0pt;
        text-indent:-.25in;
        font-family:Arial;
        mso-fareast-font-family:"Times New Roman";}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I am also interested in capturing the live
audio stream from a call.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>The best place I&#8217;ve found to start
is to modify the mixmonitor application.&nbsp; This lets you easily grab frames
from a call.&nbsp; Also, you can grab both sides of the call muxed together or separately.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Asterisk has support for audio conversion
between several formats (check frame.h for supported formats).&nbsp; There are
two ways you could take advantage of this:<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:21.0pt;text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'><span style='mso-list:Ignore'>-<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></span></span></font><![endif]><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Request
a different format when setting up the channel spy (spy.read_queue.format).&nbsp;
This only works if you&#8217;re not bridging the two sides of the call.<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:21.0pt;text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'><span style='mso-list:Ignore'>-<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></span></span></font><![endif]><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Do your
own translation using the Asterisk translation stuff
(ast_translator_built_path, ast_translate&#8230;)<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:3.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:3.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>However,
I&#8217;m not sure the Asterisk audio conversion stuff is going to be of help
to you.&nbsp; By default the audio frames you&#8217;d get in mixmonitor would
be 16-bit signed linear 8KHz and I&#8217;m guessing little endian.&nbsp; I
think you would need to perform the endianness conversion yourself.<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:3.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:3.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Hope
this helps<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> asterisk-dev-bounces@lists.digium.com
[mailto:asterisk-dev-bounces@lists.digium.com] <b><span style='font-weight:
bold'>On Behalf Of </span></b>Jamel A<br>
<b><span style='font-weight:bold'>Sent:</span></b> Tuesday, July 04, 2006 5:44
AM<br>
<b><span style='font-weight:bold'>To:</span></b> asterisk-dev@lists.digium.com<br>
<b><span style='font-weight:bold'>Subject:</span></b> [asterisk-dev] capture
and convert voice stream to a certain format</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Hello,<br>
<br>
I have a program that analyse (in live mode) voice captured by the microphone
(8KHz, 16 bit, mono, signed, big endian).<br>
I would like to analyse voice through Asterisk.<br>
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?<br>
<br>
How can I do that?<br>
<br>
Maybe, is there another solution? I know that we can record but I suppose that
we cannot read the file, wile being written...<o:p></o:p></span></font></p>

</div>

</body>

</html>