<div dir="ltr"><div><br></div><div>Hi Dennis, </div><div>I want to see the transcription while I am on a call, so I looking for real-time transcriptions.</div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Thanks & Regards <div>Manikanta</div></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jul 10, 2018 at 2:26 AM Dennis Guse <<a href="mailto:hallo@dennisguse.de">hallo@dennisguse.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Mani,<br>
<br>
just out of curiosity: what is your actual goal?<br>
Do you need to create the transcriptions live or afterwards?<br>
<br>
Best,<br>
Dennis<br>
<br>
On Fri, 2018-07-06 at 13:28 +0530, Mani Kanta Gadde wrote:<br>
> Hi, <br>
> We are trying to stream audio coming from calls to an NLP engine to get the text transcription, for this we created a socket in app_mixmonitor.c and we are writing audio frames to socket descriptor.<br>
> We have tried with TCP(SOCK_STREAM) and UDP(SOCK_DGRAM) protocols to send the audio frames to the socket server. <br>
> <br>
> We are using latest asterisk complied from GitHub source code (asterisk repo).<br>
> <br>
> Here are some of the suggestions I found on asterisk forums <br>
> <a href="http://forums.asterisk.org/viewtopic.php?f=13&t=89365#p196720" rel="noreferrer" target="_blank">http://forums.asterisk.org/viewtopic.php?f=13&t=89365#p196720</a><br>
> on this thread, it was suggested to use CHANSPY, but we have edited mixmonitor code to both record and stream in realtime, which has sufficed our needs.<br>
> <br>
> Here is the socket code we used inside the mixmonitor_thread function in app_mixmonitor.c file.<br>
> <br>
> +<br>
> + int sockfd;<br>
> + char buffer[1024];<br>
> + char *hello = "Hello from client";<br>
> + struct sockaddr_in servaddr;<br>
> +<br>
> + // Creating socket file descriptor<br>
> + if ( (sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0 ) {<br>
> + ast_log(LOG_NOTICE, "socket creation failed");<br>
> +// exit(EXIT_FAILURE);<br>
> + }<br>
> +<br>
> + memset(&servaddr, 0, sizeof(servaddr));<br>
> +<br>
> + // Filling server information<br>
> + servaddr.sin_family = AF_INET;<br>
> + servaddr.sin_port = htons(8080);<br>
> + servaddr.sin_addr.s_addr = INADDR_ANY;<br>
> +<br>
> + if (connect(sockfd,(struct sockaddr *) &servaddr,sizeof(servaddr)) < 0)<br>
> + ast_log(LOG_ERROR, "ERROR connecting\n");<br>
> + ast_log(LOG_NOTICE, "socket connected with server \n");<br>
> +<br>
> + //socket code ends here<br>
> <br>
> and here is the code of writing audio frames to the socket.<br>
> <br>
> for (cur = fr; cur; cur = AST_LIST_NEXT(cur, frame_list)) {<br>
> ast_writestream(*fs, cur);<br>
> + // writing to socket<br>
> + write(sockfd, cur->data.ptr, cur->datalen);<br>
> }<br>
> <br>
> <br>
> And we were able to see the frames on the other side of the socket. <br>
> <br>
> We want to ask you if there is any other better approach to stream audio in real time.<br>
> <br>
> Thanks & Regards <br>
> Manikanta<br>
> Zemoso Technologies<br>
> <br>
-- <br>
Dennis Guse<br>
<br>
-- <br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" rel="noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a></blockquote></div>