Code, Tutorials and Hacks
Twilioが提供するProgrammable Voiceを利用すると、電話の自動応答や発信をアプリケーションから制御することができます。 着信に応答する場合は、Twimlと呼ばれるマークアップ言語を用いることで、応答する言語や音声を設定することができます。 またこのProgrammable Voiceでは、2018年から標準の音声合成エンジン以外にもAmazon Pollyが使えるようになりました。
Amazon Pollyの合成音声は標準の合成音声に比べてとても滑らかなのですが、他の音声をリアルタイムで利用したいという声もよくいただきます。今回は株式会社エーアイ様が提供する日本語に特化した音声合成サービス、AITalk® Web API（以下 AITalk Web API）と連携してみました。
AITalk Web APIは 感情表現や自然な音声、豊富な話者ラインナップを提供する音声合成エンジンAITalkをSaaS型で利用できるサービスです。サーバーを自前で構築する必要がないため、他のSaaSやクラウドサービスと素早く連携できます。これまでは評価版の申し込みから利用開始まで少し時間がかかっていましたが、最近、Webから評価用アカウントを即時取得し利用できるようになりました。
- AITalk Web API評価アカウント
If you're building a mobile application and you need access to the user's contacts you wouldn't give it a second thought, but on the web this feature was missing. The Chrome team saw this gap and got to work on an API that makes users' contacts available to developers with the security and privacy expected on the web. That API is now available in Chrome 80 on Android M or later.
The Contact Picker API
The Contact Picker API consists of the
ContactsManager object, available as the
contacts property on the
navigator object. As it is only supported on Chrome on Android for now, the first thing we should concern ourselves with is checking for support. We can do …
Twilio Sync is a service provided by Twilio that helps you keep your application state in sync across different services. Specifically, it provides a “stack-agnostic” API that helps you add real-time capabilities to your application.
In this article, we will explore how we can build a custom real-time API analytics tool powered by Sync Lists, a Sync primitive type that helps us synchronize individual JSON objects.
NOTE: You can learn more about Sync Lists and other primitives from the Twilio Sync Object Overview.
To complete this tutorial you will need the following:
- Laravel CLI, Composer, and npm installed on your computer
- Basic knowledge of Laravel
- Basic knowledge of Vue.js
- A Twilio Account
- cURL or Postman installed to test our API endpoints
Creating the Sample Application
We will generate a fresh application with the Laravel installer and enter into the project directory with:
$ laravel …
There isn’t much live sport to watch at the moment which gives us the perfect opportunity to analyze historical data about the sport instead! In this tutorial I’m going to show you how to build a basic chatbot for WhatsApp using the Twilio API for WhatsApp and the Flask framework for Python.
The chatbot will allow users to get information about soccer teams and match statistics. Here’s an example showing how it works:
To follow this tutorial you will need the following:
- Python 3.6 or newer. You can download an installer from python.org.
- Flask. We will use this web framework to build an application that responds to incoming WhatsApp messages.
- ngrok. We will use this free utility to connect our Flask application running on our local system to a public URL that Twilio can connect to from the Internet. Installation instructions for your operating system …
Another conference call, another app, another PIN, another log-in. Joining conference calls should be as simple as dialing a phone number, without needing to enter random conference IDs. In this post, we will walk through how you can build a conference line that anyone can join, using Twilio with C# and ASP.NET Core.
Developer Environment Setup
Let's make sure you have the software you need to build this conference line. For this, you will need:
Create the ASP.NET Core Project
Get started by creating a folder for your project. I'll be using
C:\Code\Conference in this post but you can use your preferred project path. Open a command prompt and enter the following commands.
mkdir C:\Code\Conference & cd C:\Code\Conference dotnet new webapi dotnet add package Twilio code . exit
It will create …
In these unprecedented times of social distancing and a virus pandemic, we are seeing a huge increase in the number of voice calls being made. Our Supernetwork team is working around the clock to ensure that calls make it through. However, in some areas, we are seeing that lines from carriers are so congested that the calls are never reaching Twilio. Here in this tutorial, we will outline some options to bypass the congestion on the PSTN by using Twilio Client.
Twilio Client is a WebRTC based voice client that works in browsers and mobile devices using a data connection. Once a client call is connected to Twilio it can be routed directly to your existing infrastructure via SIP or uncongested PSTN paths allowing calls to continue to flow.
Currently, your customers and staff may be struggling to connect to your contact centers or business-critical services because …
You’ve just deployed Flex and you might be asking yourself: what’s next.
Next, you’ll need to start thinking about your routing and queueing strategy. In this blog post, we will cover some basic options for queueing and skilling – it sets the groundwork on how you will report and analyze your contact center business.
Let’s get started!
What We’re Building Today
Flex has the ability to leverage the full power of Twilio TaskRouter. TaskRouter is a powerful attributes-based routing system, the heart of the contact center. It’s also fully programmable, allowing you to control your contact center from your code. We’ll walk through a simple use case today: “How can I setup a contact center to support my customers and employees using Flex?”.
To do this, we are going to build two new Task Queues: Customer Service and Employee Service. These will provide the ability to …
Anyone with a baby and a cat knows maintaining the peace requires constant vigilance. Thankfully, complete vigilance can now be bought for the low price of a Raspberry Pi, a webcam and the time it takes to read the rest of this article. Here’s how I turned my Raspberry Pi into a 24/7 rent-a-cop.
Using machine learning and Twilio, your Raspberry Pi can continuously monitor any area of your home using an off-the-shelf USB webcam. This guide will walk you through how to set up your Raspberry Pi with YOLO, a real time object detection library, Darknet, an open-source neural network framework, OpenCV, a library for image processing, NNPack, a package for accelerating neural network computation, and Twilio Programmable SMS for sending notifications.
This project came out of a personal need. We’re the proud owners of:
- A Cat-obsessed baby
- A Baby-obsessed cat
For many years the famous “Hello, World” example Flask application was 7 lines long. Below you can see a snapshot of the Flask website as it looked on June 12th, 2017:
This example application then was shortened to just 5 lines. Here is the same page on June 17th, 2017:
As you can see, the core of the application has not changed, but the method by which the application server is started has indeed changed, and in a very significant way. While previously a simple
app.run() call inside the application script was used, now there is a
flask run command, plus a
FLASK_APP environment variable.
While the design of the Flask website has changed considerably in the years that followed, as I’m wri …
The ability to send and receive SMS and MMS messages programmatically is great, but how do you ensure you’re sending messages to a phone that’s capable of receiving them? If a customer provides you with a phone number when they sign up for an account, is it possible to verify the phone number’s capabilities while you’re verifying they own the phone number?
With Twilio Lookup it is, and it’s easy to integrate this capability into your ASP.NET Core projects. One of the best ways you can use this resource is to use it to determine whether your application should be sending SMS messages or voice messages using the text-to-speech capabilities of the TwiML
<Say> verb and Answering Machine Detection. With these tools you can communicate with customers asynchronously using their phone’s capabilities regardless of whether it’s a mobile or landline phone.
In this post you’ll learn how to use …