This folder has example Node.js and Python servers to generate auth tokens and
several html files (in static/) with different examples of using the Speech SDK.
There are also a few audio files to test with in the static/ folder.
- IBM Watson Speech to Text service credentials - see Service credentials for Watson services
- Node.js OR Python
- Bower for installing client-side dependencies
cdinto theexamples/directory and runnpm installto grab dependencies (this automatically runsbower install)- edit
tts-token.jsandstt-token.jsto include your service credentials (or create a.envfile) - run
npm start - Open your browser to http://localhost:3000/ to see the examples.
cdinto theexamples/directory and runpip install watson_developer_cloud flask(oreasy_install...) to install python dependencies- run
bower installto install client-side dependencies - edit
server.pyto include your service credentials (or create a.envfile) - run
python server.py - Open your browser to http://localhost:5000/ to see the examples.
- The examples all use fetch (a modern promise-based replacement for XMLHttpRequest) to retrieve auth tokens. Most supported browsers include a native fetch implementation, but a pollyfill is included in the top-level module for older browsers.
- The examples use a Node.js server to generate tokens. It doesn't have to be written in Node.js, but some server-side token generator is required. The SDK will not accept your service credentials directly, and you can not use them to generate a token client-side. SDKs are available for Node.js, Java, Python, and there is a REST API for use with other languages (or
curl). - The Speech SDK may be used in browserify, Webpack, or as a standalone library. Most of the examples use the standalone version either installed via bower or symlinked to the root directory when developing locally.