Closed DGNoise closed 4 years ago
Hi @DGNoise , thanks for opening the issue. There were some changes to the example since it uses websocket
interface. The old example code is still available here: https://github.com/watson-developer-cloud/unity-sdk/blob/master/Examples/ExampleTextToSpeechV1.cs#L142, if you want to still use that.
Now for debugging purposes, what happens when you add text and press enter? are you seeing any response at all? You should be able to see something like: Audio stream of {0} bytes received!
.
Also thanks for the input, we will try to add more instructions.
Hi @mamoonraja , thank you for your appreciated prompt reply. I think the example you indicated is the one currently contained in the 4.5.0 Watson SDK package which is the one I am trying to get to work. I just did uncomment line 73 & 74 to see whether that would make a difference, but it didn't. The problem I experience is that besides the 3 messages I listed above I do not get anything else. And if I type a new message and hit enter the same thing happens again. I never get the "Audio stream of {0} bytes received!".
Any clues why? Please check to see whether it works on your side.
Thank you!
Hi, just an update because I finally got it to work. I was eventually able to determine that the main problem was the missing URL. It might sound like an obvious thing, but let me elaborate on this, since it might be a useful feedback. Even if I am an experienced programmer I am new to both Unity and Watson SDK. From what I saw initially getting to the point I am now should have been just a matter of minutes, but instead it took me days: here is why. The toolchain both Unity as well as Watson SDK is constantly being updated and upgraded, which in principle is great, however since newer versions often require the code to be updated turns out to be a nightmare. Looking for help on the web is for the most part useless since it is full o people who claim to have found solutions which unfortunately are obsolete and not valid anymore. In all this confusion the SDK is provided with examples which are not very well documented. And in this case an example with some lines commented preventing the code to work (if I understood this correctly). The authentication for the Watson services in all this is an additional hurdle, also because it went through a few revisions. Last but not least the fact that by not providing the proper URL the system doesn't generate an error doesn't help. I personally tried several combinations of configurations without success until I started to look at the example code and when I did notice the commented lines and removed them I most likely forgot to put back the URL. The weird thing is also that when adopting the proper URL you still get a warning about wss:// instead of http:// which again is confusing since after replacing it with wss:// it still generates the warning.
These days spent in looking for a solution of course allowed me to learn a lot about Unity and the SDK, but still I think that this feedback should be used to ease the task to other users who might not be as patient as me... Thank you for your support and keep up the good work!
Thanks for the feedback, I will definitely look into error not showing up and adding more comments in example. Glad you figured it out :)
Tested speech to text example and works great. Now I spent several days on text to speech example but doesn't seem to work. Authentication OK, example runs without errors nor warnings, but when I type a string to read and hit enter I get no speech and the just the following 3 messages:
[03.05.2020 08:58:35][ExampleTextToSpeechV1][DEBUG] on listen: TEST MESSAGE UnityEngine.Debug:Log(Object) IBM.Cloud.SDK.Debug.DebugReactor:ProcessLog(LogRecord) (at Assets/IBMsdkCore/Debug/DebugReactor.cs:68) IBM.Cloud.SDK.LogSystem:ProcessLog(LogRecord) (at Assets/IBMsdkCore/Logging/Logger.cs:207) IBM.Cloud.SDK.Log:Debug(String, String, Object[]) (at Assets/IBMsdkCore/Logging/Logger.cs:229) IBM.Watson.TextToSpeech.V1.TextToSpeechService:SynthesizeUsingWebsockets(String) (at Assets/Watson/Scripts/Services/TextToSpeech/V1/TextToSpeechServiceExtension.cs:152) IBM.Watson.Examples.TextToSpeech:Update() (at Assets/Scripts/TextToSpeech.cs:65)
[03.05.2020 08:58:36][ExampleTextToSpeech][DEBUG] start-listening UnityEngine.Debug:Log(Object) IBM.Cloud.SDK.Debug.DebugReactor:ProcessLog(LogRecord) (at Assets/IBMsdkCore/Debug/DebugReactor.cs:68) IBM.Cloud.SDK.LogSystem:ProcessLog(LogRecord) (at Assets/IBMsdkCore/Logging/Logger.cs:207) IBM.Cloud.SDK.Log:Debug(String, String, Object[]) (at Assets/IBMsdkCore/Logging/Logger.cs:229) IBM.Watson.Examples.TextToSpeech:StartListening() (at Assets/Scripts/TextToSpeech.cs:116) IBM.Watson.Examples.TextToSpeech:Update() (at Assets/Scripts/TextToSpeech.cs:80)
[03.05.2020 08:58:36][TextToSpeech.CreateListenConnector()][DEBUG] Created listen socket. parsedParams: UnityEngine.Debug:Log(Object) IBM.Cloud.SDK.Debug.DebugReactor:ProcessLog(LogRecord) (at Assets/IBMsdkCore/Debug/DebugReactor.cs:68) IBM.Cloud.SDK.LogSystem:ProcessLog(LogRecord) (at Assets/IBMsdkCore/Logging/Logger.cs:207) IBM.Cloud.SDK.Log:Debug(String, String, Object[]) (at Assets/IBMsdkCore/Logging/Logger.cs:229) IBM.Watson.TextToSpeech.V1.TextToSpeechService:CreateListenConnector() (at Assets/Watson/Scripts/Services/TextToSpeech/V1/TextToSpeechServiceExtension.cs:204) IBM.Watson.TextToSpeech.V1.TextToSpeechService:StartListening(OnSynthesize) (at Assets/Watson/Scripts/Services/TextToSpeech/V1/TextToSpeechServiceExtension.cs:117) IBM.Watson.Examples.TextToSpeech:StartListening() (at Assets/Scripts/TextToSpeech.cs:119) IBM.Watson.Examples.TextToSpeech:Update() (at Assets/Scripts/TextToSpeech.cs:80)
I tried to debug but because of lack of comments in the code and the frequent change of versions I cannot understand the issue or find alternative examples. However in the main loop:
The code newer gets to the inner IF condition, which of course explains why the speech never gets played.
Please check the example to find a fix for it.
Thank you!