question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug report for speech option to be enabled on safari browser for Mac OS and iOS devices

See original GitHub issue

Very first thing, this is for webchat V4.

here is the link i followed for enbaling the speech option in safari browser:- https://github.com/microsoft/BotFramework-WebChat/blob/master/SPEECH.md#special-considerations-for-safari-on-mac-os-and-ios

There is one another link which i tested on iOS mobile device safari and Mac OS safari browser (a sample bot provided by your team):- https://microsoft.github.io/BotFramework-WebChat/06.c.cognitive-services-speech-services-js/ observations:-

  1. on iOS phone safari browser mic is visible.
  2. on Mac OS safari browser mic is not visible .

In the article provided by team, it is written that “You can present a splash screen with a tap-to-continue button, which will ready the engine by sending an empty utterance to unblock Safari.” i want code snippet to handle it which i am not getting how to achieve it for safari browser only?(not using react) i have also tried to see related options on stackoverflow but didn’t find anything relavant for webchat V4.

CONTEXT 1 : - iOS phone safari browser


These are the observations in iOS phone safari browser with your reference bot, please look into it :-

  1. if i say “hi”, bot is responding with text but no speech.
  2. if i say “help” bot is responding with series of responses and again mic will become available to talk and due to this i again clicked on mic and said “hi”.
  3. when the 2nd time i said “hi”, bot is responding with text and still no speech.
  4. after response of 2nd time “hi” the mic got disabled permanently.

i am using iphone7 plus and build version is 12.1.4 (not sure about others iOS devices) getting unsure about the functionality/behaviour of mic option in iOS

CONTEXT 2 : - Chrome on windows desktop application


With your reference bot, if i opened it on chrome browser here are the observastions: -

  1. if i say “hi”, bot is responding with different text and different speech ----- here question is why different text and different speech.
  2. if i say “help” bot is responding with series of responses and again mic will become available to talk and due to this i again clicked on mic and said “hi”.
  3. when the 2nd time i said “hi”, bot is responding with different text and different speech.
  4. but everytime bot is responding and mic is available.

Approach i have tried to embed the webchat V4 and i was successful to add the mic option and it is also visible on safari browser for iOS Device and Mac OS. the situation here is the behaviour is not as expected like in chrome windows desktop application. after one response mic is getting disabled on safari browser in both iOS and Mac.

here is my final code which i have written, working fine on chrome :-

(async function(){
const res = await fetch('https://directline.botframework.com/v3/directline/tokens/generate', {method: "POST",headers: {Authorization:"Bearer + DirectlineConnection}});
const {token} = await res.json();
const webSpeechPonyfillFactory = await window.WebChat.createCognitiveServicesSpeechServicesPonyfillFactory({
region: 'specific region',
subscriptionKey: "subscription key"
});
const store = window.WebChat.createStore();
window.WebChat.renderWebChat({
directLine: window.WebChat.createDirectLine({token}),
webSpeechPonyfillFactory,
store,
userID: "user ID",
username: "username",
locale: "en-US"
},document.getElementById('webchat'));

/inside this area i have also added the customizations like appending header, custom buttons inside webchat message panel with custom click event to send message to bot directly, etc./

document.querySelector('#webchat > *').focus();
})().catch(err =>console.error(err));

this is the code which i have finalized to use in my webhchat js file downloaded from CDN link.

Finally, in Chrome it is working and i want the expected behaviour to be on both iOS as well as Mac OS. please review the bug report and provide me the descriptive information about the possiblities of handling speech in safari browser for Mac and iOS. i am eagerly waiting for reply.

(Edited by @compulim for code formatting)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
corinagumcommented, Sep 30, 2019

This bug has been fixed and will be available in our next release in October. If you need these changes immediately, please see our documentation on pointing to our MyGet feed for latest bits.

1reaction
tdurnfordcommented, Sep 26, 2019

I’m going to try and reproduce this on my mac later today.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change Websites settings in Safari on Mac - Apple Support
In the Safari app on your Mac, use Websites settings to customize how you browse individual websites. To change these settings, choose Safari...
Read more >
Safari Technology Preview Release Notes - Apple Developer
On macOS Big Sur, this release requires enabling GPU Process: Media option from Experimental Features under the Develop menu to address issues with...
Read more >
If Safari on Mac doesn't open a webpage or isn't working as ...
The webpage might not be compatible with one or more browser settings, which you can turn on or off as needed. From the...
Read more >
Official Apple Support
Apple support is here to help. Learn more about popular topics and find resources that will help you with all of your Apple...
Read more >
iOS 16 - Apple
Easily switch devices during a FaceTime call without missing a beat. Move your call from your Mac to your iPhone or iPad with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found