i'm trying to use google STT from asterisk, the idea is to send live stream to google during session, does any one succeed ? any example will be much appreciate
Google cloud speech api have working example of python code for streaming.
Yes, it work just ok, you just need orginize stream from asterisk.
Streaming is complex to integrate, and more in the Asterisk project. The streaming allows to reduce the time processing, but I am not sure that the gain is engouth against the post processing from a record. Voximal doesn't use the streaming mode for example and it works fine. You only need to be sure that you have a good connection to reduce the uploading time.
Related
I'm coding a telegram bot with Python using the module called python-telegram-bot.
It seems working suucesfull, but I want to improve it:
It sends to user an mp3 file, in order to do it I use the following command:
context.bot.send_video(chat_id=update.message.chat_id, video=open(path+tit+'.mp4', 'rb'), timeout=360)
But when I try to execute the command, it requires about 2/3 minutes in order to send it correctly. Do you have some tips can improve this time? Or is there a more efficient way than this? Thank you in advice.
You snippet shows how to send a video instead of an audio file, but I guess that doesn't matter much here :D
If you send a file by uploading it, you will just have to wait until it's uploaded completely - how fast that works depends on your internet connection.
Sending files is faster, if you send them by URL or file id. The former may not be an option for you. The latter can be an option, if you need to send the same file multiple times. In that case, you can send it just once, save the resulting file_id and use that in the next calls.
In case you're stuck with uploading the file, you can still speed up your bot using multi threading, i.e. don't wait with uploading the file before processing the next update. See this wiki page.
Disclaimer: I'm currently the maintainer of python-telegram-bot
I would like to stream data from the client to the server.
My application streams audio data to the server. I do not know how long the audio will be when I begin streaming it. I want to reduce latency by transmitting the data as it is being recorded. Once all the data has been uploaded, then I will process it.
So, what I would like is a HTTP POST where the body is streamed. At the client, the POST would be sent as the data is available. At the server end, I would like it to arrive like a normal POST with a complete body of collected data.
I am currently using Restlet, and implementing my stream as a Chunked POST to the Restlet framework.
However, I can not find a client API that allows me to begin the POST, then start streaming the data.
I haven't found anything useful searching the archive. Can anyone give me a pointer here. Can HTTP POST be used this way? Can I use Restlet for this? Is there another standard pattern/API for streaming from the client to the server?
Many thanks in advance
Peter
Going to answer my own question for those that come after.
Here is a nice tutorial on streaming requests with Apache HttpClient
Search for "Request Streaming:"
http://hc.apache.org/httpclient-3.x/performance.html#Request_Response_entity_streaming
I can not find a client API that allows me to begin the POST
You could always use a browser. Serverside it's just the same a a file upload.
Monitoring your network while watching a Youtube live streaming (http://youtube.com/live/), you can see that they are downloading a file to your cache, and this file is actually the live stream.
Bitgravity use the same way to deliver their live stream since years (Check Twit.tv for example).
Does anyone know what is the server side used for this ? and how can someone achieve this instead of using Adobe FMS, Wowza or Red5 ?
These guys have put together an open source video streaming server, so you can look at the source code and see how they did it.
They wrote it in Java.
The current version is a working prototype, which showcases the main ideas. The main design goal is low resource usage.
there can be many ways to implement streaming, i dont think google will let you know how they do that, but it can be done even by simple http, just a simple stream that sends the video data without the "range" header so its just go on and on
A groups of friends are working on a little game that would listen to the microphone as part of the interaction. We've tinkered with processing and flex. What we'd like to know is if anyone has succeeded in:
recording from the microphone using a web app
performing an FFT on this microphone data
In the case of flex, according to the docs "Because sound data from a microphone...do not pass through the global SoundMixer object, the SoundMixer.computeSpectrum() method will not return data from those sources."1
Your footnote kind of answered your own question. :) No, it is not possible to read the raw bytes from the microphone from the client side. It is possible that Adobe will implement this in Flash 11, but don't hold your breath for it.
If you set up a flash server, such as Red5, then you can read the raw stream on the backend and send FFT data back to the client over AMF. This is actually possible to do with very low latency, though it may still be too high depending on the nature of your application. There are several examples on the Red5 page about how to accomplish things similar to this using a Java webapp working on the backend.
There is a lot of people requesting this feature.
You may see many workaround in getMicrophone().
I want to record voice online and I guess I need to use FMS or Red5 and I don't know how to use Red5 with Asp.net, actually this is my first attempt to handle such a thing and currently I am a .net developer.
So someone please show me a way to handle it and show me how to use Red5 with Asp.net.
Thanks in advance.
This is the nice page which has very good infromation abou red ands ASP http://www.aspnetajaxchat.com/Deployment_Guide.pdf
http://www.freelancer-job.com/blog/2008/08/13/flash-aspnet-coder-to-integrate-red5-based-audiovideo-chat-module-to-aspnet-website-by-zukinet/
Some more information avilable in are there any ASP.NET with Voice Recording sample codes?
I have successfully written an asp.net application to stream multiple users P2P video using Red5.
Integration of red5 is actually simple. Once you've got it working on your Server/VM all you have to do is install the olfa Demo and you can write a player/streamer in flash. You just have to set the netconnections. One for the incoming stream and another for the outgoing stream. Then you'd have to add a mic & camera capture to attach them to the outgoing stream. If you want to make your player/Streamer more robust you can use a combination of Javascript and a webservice(AJAX) to control what streams to where.
You weren't very detailed on what you wanted to do otherwise I could have probably assisted you further.
For example code go to
http://code.google.com/p/red5/source/browse/#svn%2Fflash%2Ftrunk%253Fstate%253Dclosed