Skip to content

Instantly share code, notes, and snippets.

import redis
import threading
class Listener(threading.Thread):
def __init__(self, r, channels):
threading.Thread.__init__(self)
self.redis = r
self.pubsub = self.redis.pubsub()
self.pubsub.subscribe(channels)
@mstram
mstram / app.js
Created April 15, 2023 05:26 — forked from prof3ssorSt3v3/app.js
Code from video on Intro to Web Text to Speech
let VOICE = null;
let synth = window.speechSynthesis;
let voices = synth.getVoices();
(function addListeners() {
document.getElementById('voiceSelect').addEventListener('change', changeVoice);
document.getElementById('btnRead').addEventListener('click', readParas);
document.getElementById('btnPause').addEventListener('click', () => {
synth.pause();
});