0

I am trying to continuously record 5 second snippets of audio from a phone call initiated using the Twilio API. I know that I can use TwiML and the <Record> verb, but the problem I am having is that sometimes my TwiML is in the middle of using the <Say> verb so I cannot update it with a new <Record> verb without interrupting <Say>.

I know that I can use the TwiML <Record> verb and once the max length of 5 seconds expires I can use the callback function to update the TwiML with a new <Record> and continue in this fashion. But I cannot interrupt the TwiML when I am using a <Say> in it and I need to be able to refresh <Record>.

Is there some way that I can setup a conference call such that I have one TwiML doing the <Record> and another sending the programmable voice with <Say>?

philnash
  • 70,667
  • 10
  • 60
  • 88
  • Why do you need 5 second snippets? Could you not record the entire conversation and then cut it into 5 second snippets on your server? – philnash Nov 21 '16 at 21:54
  • I essentially want to create a "semi-live" stream and pipe the result to the Watson Speech-To-Text API. From what I understand, Twilio does not allow you to access a live stream of the audio. The only way I could think to solve this problem was to take 5 second snippets of the stream and covert it as they come in. – Peter Siqueiros Nov 22 '16 at 00:55
  • I see what you're trying to get at, but I'm not sure you're going to be satisfied by this at all, breaking every 5 seconds is likely to break up speech and make it very hard for the speech recognition service to put it back together. I'd suggest asking for user inputs, using `` to receive them and then sending them off to the service. – philnash Nov 22 '16 at 09:15

0 Answers0