DEV Community

Discussion on: Announcing the Twilio Hackathon on DEV

Collapse
 
ben profile image
Ben Halpern

I am very excited to help anybody who's interested—more on the ideas side of things than the execution. Twilio's APIs are ripe for this kind of contest 😄

Collapse
 
xmikestax profile image
Michael Oppong

hey quick question, Is possible to transcribe a what a user is saying in text real-time, during the phone call?, because the only thing similar which I have seen is to record they are saying and then transcribe that audio after the phone call?

Thanks for your help

Collapse
 
philnash profile image
Phil Nash

You absolutely can!

You should check out our Media Streams API, it sends the audio data to a websocket server for you. Check out this post on how to live transcribe calls using Google Speech-to-Text.

Thread Thread
 
xmikestax profile image
Michael Oppong

Is there a python version? because all the ones I have seen are js. All I'm looking for is to be able to get a speech input from the user and turn that into text I can analyze

Thread Thread
 
philnash profile image
Phil Nash

There is a tutorial right here on how to use Twilio Media Streams in Python. Does that help?

Thread Thread
 
xmikestax profile image
Michael Oppong

thank you so much for your help, but not exactly. from this link "twilio.com/blog/2017/06/how-to-use..." I am looking for the python version of the line "event.SpeechResult.toLowerCase();" If you don't know, its alright, I appreciate the support.

Thread Thread
 
philnash profile image
Phil Nash

Oh, I see! You're using <Gather input="speech"> to get the text. Sorry, for my misunderstanding.

There's quite a bit going on in that line of your question. event comes from how you would respond to an incoming request to a Twilio Function (which is what the original blog post uses). toLowerCase() in JavaScript is lower() in Python. SpeechResult is a parameter that is sent to your application as part of the webhook request. To deal with those two bits depends on the web app framework you use in Python.

If, for example, you are using Flask. You could do something like this:

from flask import Flask, request
from twilio.twiml.voice_response import VoiceResponse

@app.route("/gather", methods=['GET', 'POST'])
def gather():
    if 'SpeechResult' in request.values:
        speech = request.values['SpeechResult'].lower()
        print("The caller said: ")
        print(speech)

    resp = VoiceResponse()
    return str(resp)

In this example, the direct translation of event.SpeechResult.toLowerCase(); is request.values['SpeechResult'].lower().

Hope that helps!

Thread Thread
 
xmikestax profile image
Michael Oppong

GAANGGGGG, THANK YOU FOR YOUR HELP BRO!
stay blessed!

Collapse
 
farazpatankar profile image
Faraz Patankar

I could use some help with the ideas. Do you have anything that you could share?

Collapse
 
bernardbaker profile image
Bernard Baker

Think of a problem you might face daily. How could Twilio solve that for you?

Now think of a problem that others might face daily. How could Twilio solve it for them? I did the latter. I thought about how people in crisis might stay in touch with others in remote areas that have limited bandwidth or technical infrastructure.

With this in mind, how might the available utilised tech be best used to solve the problem.

Take a look at my project to get a better understanding 🧐.

Hope that helps 🌏

Collapse
 
ben profile image
Ben Halpern

Any jumping off points, any hobbies/interests/etc. you might want it to relate to?

Collapse
 
gameoverwill profile image
Wilfredo Pérez

I need some ideas, because I know some things that I could do but I don't know, I feel blocked.

Collapse
 
ben profile image
Ben Halpern

What jumps out at you as an area of interest you might want to cover and what Twilio APIs are most appealing?

Thread Thread
 
gameoverwill profile image
Wilfredo Pérez

Well I want to focus on helping to get their supplies elder and in risk people, basically that.

Thread Thread
 
bernardbaker profile image
Bernard Baker

Did you come up with an idea?

What about using Twilio SMS to connect stores with vulnerable people. The store manager can connect with people and Samaritans to get supplies to them.

Thread Thread
 
gameoverwill profile image
Wilfredo Pérez

That's amazing this is the idea that I'm trying to work on.

Thread Thread
 
bernardbaker profile image
Bernard Baker

Great 🤸

What tech stack are you planning on using? Do you have an idea or preference?

Thread Thread
 
gameoverwill profile image
Wilfredo Pérez

About the tech I'm thinking to use Nodejs, and if any frontend is needed, I'll use React.

Thread Thread
 
bernardbaker profile image
Bernard Baker

Ok. Twilio has a node SDK 🌞.