Disable Speech Recognition API notification on Android Chrome - javascript

If you go to a page that uses the web SpeechRecognition API, like the demo page for Annyang.js, on the Android Chrome browser, you'll notice that once the mic starts listening for speech input, it will make a notification sound just like the Google Now speech input. And since the speech recognition is activated multiple times to make it seem like it is continuously listening, it gets very annoying.
I'd like to have a kiosk tablet that has a page using Annyang.js, or some other SpeechRecognition API library, to always be listening for commands. However, this notification sound would make it infeasible to leave the volume turned up, and I'd like to be able to play some audio.
Is there a way to disable the audible notification when activating the Speech Recognition API in Android Chrome?
This doesn't have to be on the webpage. I can modify the Android device as needed.

Related

How to detect and change Audio Input Device in Javascript while the app is running?

I am creating speech to text web application. I want to use default system Audio Input device as microphone. I want to provide a feature which is user can change Microphones while the application is running. I am able to detect the list of audio and input devices connected but not able to change the Audio Input Device. Can anyone provide a way to implement this functionality?

Can Javascript detect if a mobile device is muted?

My website is currently playing sounds when the user answers a question right/wrong. But I notice that on my tablet (iPad) and mobile (iPhone) it plays the sounds even though I put it in silence mode. And I don't want the phone/tablet to play sounds when the user has clearly set their device in silent mode (the Ringer). So, can I detect whether a device is muted/silenced and then not play any sounds? I tested on Safari and Chrome, and it always plays the sound, irrespective of the Ringer's state.
EDIT: If it is not possible to read this information, then my question would be if there is a way to play sounds that DOES respect the user's muting preferences? I am using jQuery's $("#correctsound").trigger('play'), and clearly this doesn't respect those settings. Do we have a different way to play sounds that takes these settings into account?
The simple answer to your question is no. Web pages don't have access to that kind of information about the client. More info here: Javascript: Can you read the systems volume? Furthermore, it is important to note that iOS has different volume settings for ringers and for media, according to Macworld:
The key to mastering volume adjustment is understanding that most of
the sounds on your device fall into one of two categories. General
audio includes music and other media, and the voice volume on the
iPhone and for FaceTime on all devices. The “ringers and alerts”
category includes not only the iPhone ringer, but also: FaceTime
rings; Clock app alarms; notifications and individual app alerts;
keyboard clicks; and miscellaneous app sounds like the whoosh of
sending Mail.
In other words, if a user wants to mute audio coming from web pages, they should mute the media volume. Ringer volume has nothing to do with web pages, so putting your phone in "silent" mode is only meant to affect the ringer volume. If you need help changing your device's volume settings, check out How can I lower the media volume on my iPhone when no media are playing? on the Apple Stack Exchange.

Disable default alert sound for Firefox web notifications

I'm using the Web Notification API to show desktop notifications from my web app under OSX.
In Firefox only, when a notification is triggered, it also plays a sound (in Safari and Chrome, using the exact same code, only the notification displays and there's no accompanying sound effect).
I'd like to disable the notification sound in Firefox, but I can't find anything in the documentation about controlling it. Is this possible?
On OS X, go to System Preferences, then Notifications. Choose Firefox and uncheck Play sound for notifications to get rid of the sound.
The Web Notification API now has the config option silent, but support is patchy, Chrome v43+, Firefox (not yet supported).
I'd suggest building silent into your notifications then if/when Firefox support it, it will just work.

How can I capture the AudioDestinationNode value when headphones are plugged in with Web Audio API?

I've been looking for a solution that detects the difference between the default speakers and headphones on a computer. I understand that with Web Audio API, AudioDestinationNode represents the output device, where users hear audio.
My question (to be specific) is whether or not it is possible to detect a change in the users' audio output device (wired/wireless headphones). If this is not possible, is there a way to use phonegap to do so, for computers as well as mobile devices?
My goal is to initiate an event only when the AudioDestinationNode maps to headphones or external speakers.
There's nothing in the Web Audio API spec for this.
It might be possible in Phonegap (at least if you were willing to write your own Phonegap plugin) – but that's only going to help on mobile. As far as I know, there's no way to determine the audio output device in any of the major desktop browsers.
Just out of curiosity, what are you hoping to do as a result of the user switching between built-in speakers and an external device?

Need Mobile Safari to run a java script while my iPhone is in sleep-mode

Recently I submitted an iPhone app that was rejected because it uses the APNS to push messages that could contain marketing and advertising information. Because of this, I now need to create a web app instead of a native phone app.
My problem is that I need to poll the phone’s location in the background. When Safari is in sleep mode I need to somehow have a java script running in the background to monitor location changes. Has anyone been able to do this?

Categories

Resources