WeChat public platform Message Interface Development (10) voice triggering (non-recognition)

Source: Internet
Author: User
This system tutorial uses the weather god account WeatherGod to apply weather god to the public platform, and supports nearly 400 of domestic systems. this system tutorial uses the weather god account WeatherGod to apply weather god to the public platform, the following example describes the interface development process. You are welcome to follow this account and use voice to query the local weather. for the QR code, see the bottom.


1. query the weather by entering text
Generally, the query is implemented by city name, pinyin, and area code. Basically, the query database is used to obtain the corresponding query interface, and then the query weather is sent, encapsulate the result into a weather format and send it to the user. For example, the following are weather queries by name, pinyin, area code, and zip code.


2. query the weather without entering text

1. simplicity

For the query method, the complexity of the query is the area code> ZIP Code> City name> Pinyin.

  • Generally, the area number is 3-4 digits, so it is the easiest to enter. in a few cases, different cities share the same phone area number.
  • There is a problem with the zip code that the match is not accurate. a city has many ZIP codes, and some cities have the same digits and some of the first three are the same, some of the first four digits are the same.
  • The city name is ranked by 3rd. because we often get used to Chinese input, it is easy to input, but the number of buttons is large.
  • Pinyin is the most difficult to lose because it often matches words automatically (on my mobile phone, in other words, there are too few people who usually use pinyin.

Is there a simpler way?
If you do not enter text, you can only send other messages. The other best input method is voice.

2. voice triggered

Currently, the public platform does not support voice recognition interfaces, and developers cannot obtain the address of the sent voice file. Therefore, they cannot identify the voice content sent by users.

However, the public platform supports voice sending to the public account. with this function, we can make a sentence to help you query weather applications, and this sentence can be used in any way, that is, press the button that you want to talk to and loosen your hands in one second to automatically query the weather and return the results.

See:

The query result is obtained after a single sentence is given to the other party. This is a big step ahead of the query methods for entering names, pinyin, area codes, and zip codes, because you no longer need to enter tedious names, in most cases, most people are fixed in one place without changing the geographical location. Therefore, this function is very practical for them.

3. smart memory

But how do I know what the user has checked? This requires the user to perform another effective query. the backend stores the query record in the database and obtains the record during the next voice query, so that the user can find the city.

Therefore, we need to make another reply setting for the first voice query.

The observations over the past few days show a very interesting phenomenon. when a user sends a text query, it generally sends local city information. when the user sends a voice, you 'd like to name a local city on your phone.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.