Comments (3)
I already played with this API and wanted to implement it in the next version. But as far as I know it is not possible to start the speech automatically. So the user would have to click on a button to start the playback which is useless in my opinion.
Please let me know if you have an idea how to start the playback automatically.
from siri-api.
Hi,
I didn't realized this limitation that will have a big impact on the user experience. It's seems that this user found a workaround : http://www.broken-links.com/2013/09/20/web-speech-api-part-one-speech-synthesis/
"Update: From a little further experimentation it looks like on iOS the speech must be initiated by a user action, rather than on page load (for example). Also, I’ve added a little easter egg to my site: if you’re using Chrome Canary or Safari 6.1/7 (both for OSX), try using the site search box…"
copy/past of his source code (not yet tested)
window.addEventListener('DOMContentLoaded', function(){
if(window.speechSynthesis != 'undefined') {
var frm = document.getElementById('say'),
pitchRange = document.getElementById('pitch'),
rateRange = document.getElementById('rate'),
volRange = document.getElementById('volume'),
foo, txt, langRadio;
frm.addEventListener('submit',function(e){
e.preventDefault();
var voices = window.speechSynthesis.getVoices();
//console.log(voices);
langRadio = document.querySelector('input[type=radio]:checked');
txt = document.getElementById('sayit').value;
foo = new SpeechSynthesisUtterance(txt);
foo.lang = langRadio;
foo.pitch = pitchRange.value;
foo.rate = rateRange.value;
foo.voice = voices[10];
foo.voiceURI = 'native';
foo.volume = volRange.value;
window.speechSynthesis.speak(foo);
//console.log('Said',foo);
});
}
});
I hope you will find useful info otherwise, i will try to create a static page and make some investigations on my side.
Johnny -
from siri-api.
This workaround only works on Chrome and Safari on Mac OS X but not on iOS. I tried the easter egg on my iPad and iPhone with iOS 7 and as expected it did not work.
from siri-api.
Related Issues (20)
- Siri internal Bing search?? HOT 2
- Squid dosent start on startup HOT 2
- No such file or directory proxy.pac HOT 10
- Google Siri turn on light one dont work HOT 1
- Squid The requested url could not be retrieved HOT 1
- Issue with iOS8 HOT 6
- google normally appears HOT 65
- Squid does not forward to Siri-API HOT 1
- plugin for siri api HOT 1
- Siri API installation on RPi HOT 1
- This page is unavailable HOT 5
- afetr run Squid ... HOT 8
- https resquest HOT 1
- Html respond auto close HOT 5
- add command HOT 13
- Deal with upper and lower cases HOT 6
- Using wildcard for the first search word does not work HOT 10
- Search defect HOT 2
- Problem with Raspberry Pi and Python HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from siri-api.