le-chat-php icon indicating copy to clipboard operation
le-chat-php copied to clipboard

Feature request: different sounds on PM and room message receiving

Open CaptainStormblade opened this issue 4 years ago • 10 comments

Hello,

I am asking this as a blind user. Could it be possible to get sounds for the PMs and room-wide messages? Also, could it be possible to get SAPI to read the messages. Asking this for other blind users as well who have to refresh the page and read it with their screen readers to get the new messages.

Thanks.

CaptainStormblade avatar Feb 14 '21 19:02 CaptainStormblade

Any idea on this?

CaptainStormblade avatar Jul 25 '21 12:07 CaptainStormblade

Hello @Finnboy94 ,

thanks for the feature request. That's a great idea. This would require tracking the last shown message in the user session and injecting an auto-play sound file on a new message. There should also be an option in the users profile settings on whether they want a notification for all types of messages, only PMs, or disable the sound all together. Perhaps also an option for the admins to set a default. It would also be nice to have several sounds to select from.

SAPI seems to be a Microsoft product meant for applications. There is however also a Web Speech API, which is directly built into browsers. To make use of it, JavaScript would be required and language information needs to be associated with each message, since attempting to speak a text of another language than the reader's setting would be hard to understand.

DanWin avatar Jul 25 '21 13:07 DanWin

Ah, a great amount of work I see. Would this be perhaps doable at some point? I can provide sound files to choose from on the different types of messages. I don't know much about JavaScript and PHP myself - this just came into my mind when discussing this chat with a few other blidn people.

CaptainStormblade avatar Jul 25 '21 14:07 CaptainStormblade

Yes, it's certainly doable and a great addition to have. Overall there are probably several accessibility improvements that could be made and have so far been overlooked or not adequately thought of. For example correctly labelling each input field with aria attributes, that can be accessed by screen readers and other accessibility tools. Also another interesting aspect could be the captcha implementation, that is supposed to stop spam bots. Currently there is only a visual image with different levels of complexity/distortion. As a blind person it would be impossible to solve this captcha, unless you have a good OCR software, which can read the captcha. At the most basic level this would probably still be readable to an OCR software, but the more difficult levels need specific training on how to read those properly. Here a server-generated audio sample comes to mind, which may also receive different levels of distortion in terms of pitch, different voices, background noise, etc.

DanWin avatar Jul 26 '21 20:07 DanWin

Also, could it be possible to get SAPI to read the messages. Asking this for other blind users as well who have to refresh the page and read it with their screen readers to get the new messages.

I'd enjoy hearing you go into further detail about SAPI and how it relates with this (given that is is a Microsoft Application).

ghost avatar Jul 27 '21 03:07 ghost

Also, any suggestions on the sounds?

ghost avatar Jul 27 '21 19:07 ghost

SAPI was only a suggestion - the web speech API that is directly built into browsers is probably far better. As for the CAPTCHA, I have just disabled it for my own chat as it is being used by many blind users. Something I have noticed is that the refresh seems to throw the focus of a screen reader to the buttons in the bar (like Messages, Administration etc). I have solved this, at least somehow, by globally hiding the user list. That way it does not come in between the messages and hte buttons when a blind person views the page with their screen reader.

CaptainStormblade avatar Jul 29 '21 17:07 CaptainStormblade

Also, any suggestions on the sounds?

I can add a sounds folder with a few suggestions to my fork. I have many sound ideas in mind.

CaptainStormblade avatar Jul 29 '21 17:07 CaptainStormblade

PR #109 has some sample files.

CaptainStormblade avatar Jul 30 '21 13:07 CaptainStormblade

Nice! I definitely want to give that a look.

ghost avatar Jul 31 '21 17:07 ghost