Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: web speech api

web speech api 2 years 8 months ago #106180

  • ddrmoscow
  • ddrmoscow's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 9
  • Thank you received: 5
  • Karma: 2
Hello,
Have anybody tried to add "Web speech API" feachure to enable speech recognition for text input fields?
I've succeed only with short text type questions, here's the script:
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
var thisQuestion = $('#question{QID}');
$('input[type="text"]', thisQuestion).attr('x-webkit-speech','x-webkit-speech');
});

</script>

But it doesn't work for long and huge text fields, neither for comments.

Would be nice to have an option of speech input instead of typing long texts,
Cincerely,
Alex
The administrator has disabled public write access.

web speech api 2 years 8 months ago #106182

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9600
  • Thank you received: 1376
  • Karma: 390
2 minute in google and :
The x-webkit-speech attribute can be used on any HTML5 input element with a type of text, number, tel, or search. Unfortunately, it’s not permitted on textarea fields. I suspect that’s to stop people using it for long dictations which could result in inaccurate results or high memory usage.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (use private message).
Last Edit: 2 years 8 months ago by DenisChenu.
The administrator has disabled public write access.

web speech api 2 years 8 months ago #106183

  • ddrmoscow
  • ddrmoscow's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 9
  • Thank you received: 5
  • Karma: 2
Denis,Thank you for reply,
Yes, you're right , they could not manage this few years ago, untill i found page 14 especially where they declare textarea as well
The administrator has disabled public write access.

web speech api 2 years 8 months ago #106186

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9600
  • Thank you received: 1376
  • Karma: 390
Then:
$('input[type="text"],textarea', thisQuestion).attr('x-webkit-speech','x-webkit-speech');
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (use private message).
The administrator has disabled public write access.
The following user(s) said Thank You: ddrmoscow
Time to create page: 0.243 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form