在JavaScript中评估屏幕阅读器的当前状态 [英] Evaluating current state of a screen reader in JavaScript

查看:110
本文介绍了在JavaScript中评估屏幕阅读器的当前状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在过去的两年里一直在做屏幕阅读器优化而没有问题,但现在我正在开发一个将音频播放作为核心功能的应用程序。据我所知,当屏幕阅读器正在运行时,没有办法推迟播放,而且我的所有音频流现在正在相互交谈。我已经多次通过WAI-ARIA规范,以至于我怀疑我正在寻找的功能是否包含在那里。

I've been doing screen reader optimization for the last 2 years without issue, but now I'm developing an application that has audio playback as a core piece of functionality. As I understand, there's no way to defer playback while a screen reader is running and all of my audio streams are talking over each other right now. I've been through the WAI-ARIA specs many times to the point that I doubt the feature I'm looking for is included there.

是否有任何整体屏幕阅读器JavaScript可以访问API,这样我就可以协调我的应用程序音频,使其与可访问性设备不重叠?我可以只听一个回调或订阅一个事件—像 window.addEventListener('screenReaderAudioFinished',handlerFn);

Is there any overall screen reader API accessible by JavaScript that would allow me to coordinate my applications audio to not overlap with accessibility devices? Something where I can just listen to a callback or subscribe to an event—something like window.addEventListener('screenReaderAudioFinished', handlerFn); ?

TL; DR 我正在寻找JavaScript中的某种方式,以便在屏幕阅读器完成讲话时得到通知。回调,事件,任何事情。

TL;DR I'm looking for some way in JavaScript to be notified when a screen reader is finished speaking. Callbacks, events, anything.

推荐答案

TL; DR浏览器中不存在您要查找的内容

TL;DR What you are looking for does not exist in the browser

听起来你正在开发游戏,如果这是真的,那么你可以做的就是完全接管正在发生的公告 - 主要是实现你自己的屏幕阅读器。这可以通过在键盘操纵的控件上实现具有虚拟光标的应用程序区域来实现。此日历小部件显示了如何通过键盘和手势控制实现此功能。

Sound like you are developing a game, If that is true, then what you could do is completely take over the announcements that are happening - essentially implementing your own screen reader. This could be achieved by implementing an application region with a virtual "cursor" on the controls manipulated by the keyboard. This calendar widget shows how this can be achieved for both keyboard and gesture control.

http://dylanb.github.io/datepicker/datepicker.html

音频输出可以通过你自己实现音频管道。如果你有能力播放音频,那么写这个应该是相当微不足道的,但混合选择和优先级可能是困难的部分。

Audio output could be implemented through your own audio pipeline. If you have the ability to play audio, then writing this should be reasonably trivial but mixing choices and priorities might be the hard part.

你不应该只是宣布控制当用户移动到不同的控件时,用户会移动到,但是您还应该有一个音频描述轨道来描述动画中发生的事情,如果这些很重要的话。

You should not only be announcing the controls a user moves to when they move to different controls, but you should also have an "audio description" track that describes what is happening in the animations if these are important.

如何混合声音取决于在任何给定时间最重要的内容以及用户与游戏的交互是否存在实时组件。

How you mix the sounds depends on what is most important at any given time and whether there is any "real-time" component to the user's interactions with the game.

这篇关于在JavaScript中评估屏幕阅读器的当前状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆