{"action":"opened","issue":{"url":"https://api.github.com/repos/watson-developer-cloud/node-sdk/issues/816","repository_url":"https://api.github.com/repos/watson-developer-cloud/node-sdk","labels_url":"https://api.github.com/repos/watson-developer-cloud/node-sdk/issues/816/labels{/name}","comments_url":"https://api.github.com/repos/watson-developer-cloud/node-sdk/issues/816/comments","events_url":"https://api.github.com/repos/watson-developer-cloud/node-sdk/issues/816/events","html_url":"https://github.com/watson-developer-cloud/node-sdk/issues/816","id":391529017,"node_id":"MDU6SXNzdWUzOTE1MjkwMTc=","number":816,"title":"[text-to-speech] new API doesn't work","user":{"login":"mrwnmonm","id":1739939,"node_id":"MDQ6VXNlcjE3Mzk5Mzk=","avatar_url":"https://avatars0.githubusercontent.com/u/1739939?v=4","gravatar_id":"","url":"https://api.github.com/users/mrwnmonm","html_url":"https://github.com/mrwnmonm","followers_url":"https://api.github.com/users/mrwnmonm/followers","following_url":"https://api.github.com/users/mrwnmonm/following{/other_user}","gists_url":"https://api.github.com/users/mrwnmonm/gists{/gist_id}","starred_url":"https://api.github.com/users/mrwnmonm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrwnmonm/subscriptions","organizations_url":"https://api.github.com/users/mrwnmonm/orgs","repos_url":"https://api.github.com/users/mrwnmonm/repos","events_url":"https://api.github.com/users/mrwnmonm/events{/privacy}","received_events_url":"https://api.github.com/users/mrwnmonm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-17T01:37:33Z","updated_at":"2018-12-17T01:37:33Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\nWe are trying to migrate our text to speech implementation to the new authentication method.\r\nWe were able to obtain the access token from curl and the authentication API, then we tried to use raw websockets, but we didn't receive any data.\r\n\r\nSo we followed the example [here](https://github.com/watson-developer-cloud/node-sdk/blob/master/examples/text_to_speech_websocket.js) (which is updated 13 days ago) which still authenticate using the old method (username and password), but we received no data using that too.\r\n\r\nHere is our code (just a dummy script):\r\n```javascript\r\nvar TextToSpeechV1 = require('watson-developer-cloud/text-to-speech/v1');\r\n\r\nvar textToSpeech = new TextToSpeechV1({\r\n//   iam_apikey: '<api_key>',\r\n//   url: '<service_url>'\r\n  username: \"<username>\",\r\n  password: \"<password>\"\r\n});\r\n\r\nvar synthesizeParams = {\r\n    text: 'Hello world',\r\n    accept: 'audio/mp3',\r\n    voice: 'en-US_AllisonVoice'\r\n};\r\n\r\nasync function f() {\r\n    let promise = new Promise((resolve, reject) => {\r\n        // Pipe the synthesized text to a file.\r\n        var synthesizeStream = textToSpeech.synthesizeUsingWebSocket(synthesizeParams)\r\n        \r\n        synthesizeStream.on('message', (message, data) => {\r\n            console.log(data)\r\n        })\r\n        synthesizeStream.on('close', (code, reason) => {\r\n            console.log(code)\r\n            resolve(\"100\")\r\n        })\r\n        synthesizeStream.on('error', (err) => {\r\n            console.log(err)\r\n        })  \r\n    });\r\n  \r\n    let result = await promise; // wait till the promise resolves (*)\r\n    console.log(result); // \"done!\"\r\n}\r\n  \r\nf().then(()=>{\r\n    console.log(\"done\")\r\n});\r\n```\r\nNotice that the example uses the old authentication method, and the docs [here](https://console.bluemix.net/apidocs/text-to-speech?language=node) uses the `api_key` and the `url`, **but both methods don't work**, we can't receive data using either of them.\r\n\r\nNotice also that the docs [here](https://console.bluemix.net/apidocs/text-to-speech?language=node#synthesize-audio) uses the `synthesize` function which doesn't even exist in the [sdk](https://github.com/watson-developer-cloud/node-sdk/blob/master/text-to-speech/v1.ts), while the example (and our code above) uses `synthesizeUsingWebSocket` which does exist in the sdk, but also doesn't work.\r\n\r\nSo something is deeply wrong here.\r\n\r\n- Expected behavior: Receive audio data.\r\n- Actual behavior: Receiving no data.\r\n- Node version: 8.5.0\r\n- SDK version: 3.15.0\r\n"}}
{"actor":{"display_login":"mrwnmonm"}}