Closed nazarparuna closed 6 years ago
Hi,
I have release a new version (2.0.3) which should solve the issue for you. Please note that the API has changed a bit and is now all promise-based.
Hello, I tried new version, but there are still issues. On Android I put alert in then(), but it does not work every time. On iOS I cannot hear/see anything. Let me explain: I don't hear voice, don't see alert that initialization failed and don't see alert that speaking failed. I put my test example here. I will appreciate any help.
Hi. Could you specify which version of android and ios and which browser you are using ? Is the demo link in the readme file working for you ?
Ive just tried the demo link on ios12 on safari with an iphone and it works. Perhaps you have a different version ?
Hi. Could you specify which version of android and ios and which browser you are using ? Is the demo link in the readme file working for you ?
I use Android 8.1 ( Chrome Beta) and iOS 11 (Safari 11). Yes, demo works.
There is a known bug on android which sometimes make the voice loading fail. I will fix this with a workaround in the next version. Regarding ios if the demo link works I cant see a particular reason why it wouldnt work on your project 😢
Have only one question on iOS does it trigger first phrase 'If you hear my...'?
Im sorry I dont understand the question. Could you rephase please ?
When you tried my test example on iOS. The first phrase was 'If you here my voice...'?
Sorry I cannot try your example imi on holidays and away from any computer. I just tried my demo link on my sisters iphone and my android phone 😀
Is your speech synthesis triggered by a user action such as a click ? I believe on ios it needs to be . If not try to plug it on a click event and see if it makes any difference
Is your speech synthesis triggered by a user action such as a click ? I think on ios it needs to be
No, I tried to trigger it after init
this.speech.init().then((data)=>{ this.speech.speak({ text : this.text }).then((d) => { alert('finish speak'); })
That would be the reason of your problem then, apple doesnt allow speech synthesis without a user action
Is it described anywhere?
I cant find any official link from apple but the problem is mentionned by various people on many stack overflow pages and blog posts. Also this s a common problem with many web apis and ios. You can particularly check out rosskyl answer on this thread. https://github.com/Microsoft/BotFramework-WebChat/issues/995 I will do a fix soon for the android issue but consider the ios problem resolved. Ill add a section for ios in the readme
Thank you a lot. I will be waiting for your new version
No worries. Ill probably do it this weekend when I get back to france.
Hi @nazarparuna . I've published version 2.0.6 (https://www.npmjs.com/package/speak-tts) which should solve your issues on android. Please let me know how it goes !
Please note that there is no more onVoicesLoaded function. you can either retrieve the voices from the data passed to the resolved init() Promise, or use the props 'listeners' to add an 'onvoiceschanged' listener.
@nazarparuna: may I close this issue ?
Yeah. Sure. Thank you
I have a problem with speaking on mobile (Android-Chrome, IOS-Safari). I call Speech.init() method from constructor of component. I put alert in 'onVoicesLoaded' function, so i see that it works, after that I try to speak some sentences, but there is no voice. I have some button on UI, so when i click them it starts speaking. On Linux with Chrome it works perfect. I load page, voices are loaded, I hear a speech. I will be very glad to get response from you)