Skip to main content

Wrp.html

The sample program Wrp.js (wrp.html) is an application that runs in a browser.

The wrp.html file will not work if you double-click it to open directly in a browser. Please place this file on a web server and open it from https:// or http://localhost/.

tip

The reason why the wrp.html file doesn't work when you double-click to open it directly in a browser is that sample programs from version 1.1.9 onwards use the AudioWorklet of the Web Audio API for audio processing, and this API doesn't work when the file is opened directly as file://. If you want to run it by opening the file directly, please use the wrp.html in the DEPRECATED folder. However, the files in this folder use the deprecated API ScriptProcessorNode, which may become unusable in the future. Also, sample programs using ScriptProcessorNode will not be updated in the future.

note
  • To run, you need to set your own APPKEY displayed on your My Page
caution
  • Please note that usage fees will be incurred according to the speech recognition used

Preparation

Here, we explain the procedure for running the sample program in an environment where Python3 is installed.

  1. Download the sample program and extract it to any directory on your local machine.
  2. Open the extracted directory in the terminal
  3. Execute the following command to start the HTTP server.
python3 -m http.server --bind localhost 8081
  1. Access the following in your browser to open the sample program.

http://localhost:8081/Wrp/javascript/wrp.html

You should see a screen like the following execution example.

Execution Example

  1. When you access it in your browser, it will be displayed as follows.
  2. Enter the [サービス ID] from your My Page in the [サービス ID] field.
  3. Enter the [サービスパスワード] from your My Page in the [パスワード] field.
  4. Click the [ワンタイム APPKEY 取得] button.
  5. Confirm that the one-time APPKEY has been entered in the [APPKEY] field.
  6. Click the [録音の開始] button.
  7. Click [許可] in the microphone usage permission dialog.
  8. Speak Japanese freely.
  9. In the lower half of the page, the recognized text and events sent from the server will be displayed one after another.