social_stream icon indicating copy to clipboard operation
social_stream copied to clipboard

Enable text-to-speech for New members

Open diegoveloper opened this issue 2 years ago • 7 comments

hello, there is a text-to-speech option for Donations only, is there any config that we can use to enable the TTS for New members too? Like this

welcome_developer

And if we can have the autoselection also for the new members (like we have for donations), that would be great! :D

diegoveloper avatar Jan 12 '23 06:01 diegoveloper

There's an auto highlight mode for donations only.

"When auto-selecting is on, only auto-select donations". If you use this and the tts mode, you should be able to have donations read out that way automatically.

I'm not sure about new members; I probably could add that in if not.

steveseguin avatar Jan 15 '23 03:01 steveseguin

Yeah, auto highlight for donations only works perfect, but not for new members.

On Sat, Jan 14, 2023, 10:47 PM Steve Seguin @.***> wrote:

There's an auto highlight mode for donations only.

"When auto-selecting is on, only auto-select donations". If you use this and the tts mode, you should be able to have donations read out that way automatically.

I'm not sure about new members; I probably could add that in if not.

— Reply to this email directly, view it on GitHub https://github.com/steveseguin/social_stream/issues/52#issuecomment-1383048065, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFL3UE2HITIHAW4XFAHU33WSNXOZANCNFSM6AAAAAATY3KOOA . You are receiving this because you authored the thread.Message ID: @.***>

diegoveloper avatar Jan 15 '23 04:01 diegoveloper

Any chance on this? :D

diegoveloper avatar Jul 02 '24 00:07 diegoveloper

Added it, but I haven't had time to test it yet.

image

or &ttsnewmembers , added to the featured.html page

steveseguin avatar Jul 02 '24 17:07 steveseguin

hello, I tried using &ttsnewmembers on this url

https://socialstream.ninja/featured.html?session=[session_id]&showtime=40000&voice=jorge&tts=es-ES&latency=0&pitch=0.4

so it was

https://socialstream.ninja/featured.html?session=[session_id]&showtime=40000&voice=jorge&tts=es-ES&latency=0&pitch=0.4&ttsnewmembers

but then when a new super chat came, the voice didn't play :(

diegoveloper avatar Jul 31 '24 03:07 diegoveloper

Is a super chat the same as a new member? I think super chat counts as a donation, so you'll need to add &ttsdonos as well. One to read out new members, and one to tell the system to read out donations.

steveseguin avatar Jul 31 '24 10:07 steveseguin

ok, I see, when I have this :

https://socialstream.ninja/featured.html?session=[session_id]&showtime=40000&voice=jorge&tts=es-ES&latency=0&pitch=0.4

I can see the featured message with voice/sound (with donations or message that I selected from the dock, which is what I need).

when I add any of these or both &ttsdonos&ttsnewmembers , the featured message stop playing sounds when i select the message from dock if it doesn't have donation but it works with message with donation.

Any chance to do :

  • show / play sound any message that I selected from the dock and is displayed in featured message?
  • show automatically the donation message with voice (I think this is working).
  • show a featured message of a new member with voice (I didn't test this but I suppose ttsnewmembers should work)

diegoveloper avatar Jul 31 '24 16:07 diegoveloper

hi @steveseguin , do you know what's the event/method (and in which file is that) when user TAP a message on the dock?

diegoveloper avatar Aug 04 '24 04:08 diegoveloper

selectedMessage(false, ELEMENT) ?

steveseguin avatar Aug 04 '24 21:08 steveseguin

I added an else condition here: https://github.com/steveseguin/social_stream/blob/main/featured.html#L2389C5-L2404C10

Like this:

else if(msgPlain) {
		speak(chatname + "! ! .. " + msgPlain);
}

I also added some console logs and it's going there, but the bot is not talking, do you know what could be the reason?

This s the log

You can do &voice=VOICENAME to try to force select a voice based on a partial string match of its name.
featured.html?session=[session_id]&showtime=40000&voice=jorge&tts=es-ES&latency=0&pitch=0.4&ttsdonos&ttsnewmembers:1634 (179) [SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, …]
featured.html?session=[session_id]&showtime=40000&voice=jorge&tts=es-ES&latency=0&pitch=0.4&ttsdonos&ttsnewmembers:1655 Voice being used:
featured.html?session=[session_id]&showtime=40000&voice=jorge&tts=es-ES&latency=0&pitch=0.4&ttsdonos&ttsnewmembers:1656 SpeechSynthesisVoice {voiceURI: 'Jorge (Spanish (Spain))', name: 'Jorge (Spanish (Spain))', lang: 'es-ES', localService: true, default: false}

I just want the bot talk when:

  • there is a new donation (automatically)
  • there is a new member (automatically)
  • when I select a message from the dock

can you help me?

diegoveloper avatar Aug 05 '24 05:08 diegoveloper

Where do you want the voice to come from; the featured.html page or the dock.html page?

For example, you can right-click a message in the dock and hit "text to speech", and I believe it should play.

By adding &ttsdonos &ttsnewmembers, those specifically tell the featured page not to play audio UNLESS its one of those. Whether you manually select it or automatically select it from the dock, it has no idea. No data is being passed from the dock to the featured chat page that you've manually selected it vs it being automatically selected.

To solve this, we need to include some meta data with the message object we are sending to the featured chat page, and then add logic to the speech logic to make an exception for messages of that marking.

steveseguin avatar Aug 05 '24 13:08 steveseguin

image

steveseguin avatar Aug 05 '24 13:08 steveseguin

perfect, thank you so much!

just for the record, this is the URL : https://socialstream.ninja/featured.html?session=[session_id]&showtime=40000&voice=jorge&tts=es-ES&latency=0&pitch=0.4&ttsdonos&ttsnewmembers&ttsclicked

diegoveloper avatar Aug 05 '24 16:08 diegoveloper