toomastahves / speech-to-text-example

Speech to text example with IBM Watson, React, Node.
MIT License
0 stars 1 forks source link

is not working in ubuntu #1

Open johnfelipe opened 8 years ago

johnfelipe commented 8 years ago

http://181.135.63.86:3008/

How can i fix this?

toomastahves commented 8 years ago

Hey

I updated and refactored code. Last commit should work.

Demo here: https://speechtotextdemo.herokuapp.com/

johnfelipe commented 8 years ago

How can use only spanish? El 7/6/2016 10:31 AM, "Toomas Tahves" notifications@github.com escribió:

Hey

I updated and refactored code. Last commit should work.

Demo here: https://speechtotextdemo.herokuapp.com/

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/toomastahves/speech-to-text-example/issues/1#issuecomment-224318527, or mute the thread https://github.com/notifications/unsubscribe/AAaLFJv09rtpoZNCpZQW8UtOJyYSSApSks5qJY7ggaJpZM4IvvMv .

toomastahves commented 8 years ago

URL is in this file https://github.com/toomastahves/speech-to-text-example/blob/master/client/actions/microphone.js#L30

const url =wss://stream.watsonplatform.net/speech-to-text/api/v1/recognize?watson-token='${token}'&model=en-US_BroadbandModel;

Replace en-US with es-ES

johnfelipe commented 8 years ago
sudo nano /home/felipe/speech-to-text-example/server/webpack/devServer.js

##
import webpack from 'webpack';
import config from '../../webpack.config.dev';
import WebpackDevServer from 'webpack-dev-server';

export const startWebpackDevServer = () => {
  new WebpackDevServer(webpack(config), {
    historyApiFallback: true,
    noInfo: true,
    publicPath: config.output.publicPath,
    proxy: {
      '*': 'http://0.0.0.0:3008'
    }
  })
  .listen(1337, '0.0.0.0', () => {
    console.log('WebpackDevServer started at 0.0.0.0:1337');
  });
};
##

is not woring how can update for run in ip, no localip?

toomastahves commented 8 years ago

Last commit have localhost replaced with numbers, maybe it helps, here you can see places that have changed: https://github.com/toomastahves/speech-to-text-example/commit/93afacf1465a6746aee38d458b7c49065a0c73e6

johnfelipe commented 8 years ago
felipe@felipeurrego:~/speech-to-text-example$ npm start

> speech-to-text-example@0.0.1 start /home/felipe/speech-to-text-example
> nodemon server/index.js

[nodemon] 1.9.2
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node server/index.js`
Koa started at 3008
WebpackDevServer started at localhost:1337

i update 93afacf for different port 3000 to 3008 and still not woring

johnfelipe commented 8 years ago
felipe@felipeurrego:~/speech-to-text-example$ npm install
felipe@felipeurrego:~/speech-to-text-example$ npm start

> speech-to-text-example@0.0.1 start /home/felipe/speech-to-text-example
> nodemon server/index.js

[nodemon] 1.9.2
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node server/index.js`
Koa started at 3008
WebpackDevServer started at localhost:1337

not working

toomastahves commented 8 years ago

You can try to run command 'npm run run:prod'. It builds and starts production build without devServer. Then it runs just on port 3000 (or 3008 in your case).

johnfelipe commented 8 years ago
felipe@felipeurrego:~/speech-to-text-example$ npm run run:prod

> speech-to-text-example@0.0.1 run:prod /home/felipe/speech-to-text-example
> npm run build:prod && npm run start:prod

> speech-to-text-example@0.0.1 build:prod /home/felipe/speech-to-text-example
> cross-env NODE_ENV=production webpack --config webpack.config.prod.js

Hash: 9115b3babf2c969cd122
Version: webpack 1.13.1
Time: 42837ms
                               Asset     Size  Chunks             Chunk Names
b53ff55e09a092f9f0cbbf74af01b715.svg   2.9 kB          [emitted]
                           bundle.js   287 kB       0  [emitted]  main
                       bundle.js.map  2.73 MB       0  [emitted]  main
   [0] multi main 28 bytes {0} [built]
    + 523 hidden modules

> speech-to-text-example@0.0.1 start:prod /home/felipe/speech-to-text-example
> cross-env NODE_ENV=production node server/index.js

Koa started at 3008

http://181.135.63.86:3008/

Not show it

johnfelipe commented 8 years ago
sudo nano /home/felipe/speech-to-text-example/client/actions/microphone.js
##
const url = `wss://stream.watsonplatform.net/speech-to-text/api/v1/recognize?watson-token='${token}'&model=en-US_BroadbandModel`;

To

const url = `wss://stream.watsonplatform.net/speech-to-text/api/v1/recognize?watson-token='${token}'&model=es-ES_BroadbandModel`;
##

npm install

sudo nano /home/felipe/speech-to-text-example/client/constants/index.js

##
export const SERVER_URI = process.env.SERVER_URI || 'http://127.0.0.1:3000';
to
export const SERVER_URI = process.env.SERVER_URI || 'http://127.0.0.1:3008';
##

sudo nano /home/felipe/speech-to-text-example/server/server.js
##
const port = process.env.PORT || 3000;
To
const port = process.env.PORT || 3008;
##

sudo nano /home/felipe/speech-to-text-example/server/webpack/devServer.js

##
To
      '*': 'http://127.0.0.1:3008'
##

npm run run:prod
toomastahves commented 8 years ago

Maybe Node version different, i currently run Node 6.2.1.

johnfelipe commented 8 years ago

i have this

felipe@felipeurrego:~$ node --version
v4.4.4
johnfelipe commented 8 years ago

then node 4.4.4 is not working for u demo?

toomastahves commented 8 years ago

I tried Node v4.4.4 now, works there too.

johnfelipe commented 8 years ago

pls share me command history