fotografia:camaras:streaming:obs
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
fotografia:camaras:streaming:obs [2024/11/09 22:12] – created jose | fotografia:camaras:streaming:obs [2024/11/11 02:19] (current) – jose | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== OBS ====== | ====== OBS ====== | ||
- | Texto dinámico | + | Texto dinámico |
https:// | https:// | ||
+ | |||
+ | Rótulo con animación. Hacer un grupo con texto y caja, botón derecho y "Show transaction" | ||
+ | https:// | ||
+ | |||
+ | ====== Configurar tecla con voz ====== | ||
+ | < | ||
+ | import pyaudio | ||
+ | from vosk import Model, KaldiRecognizer | ||
+ | import json | ||
+ | import subprocess | ||
+ | from gtts import gTTS | ||
+ | import os | ||
+ | |||
+ | # Cargar el modelo de Vosk | ||
+ | model = Model(" | ||
+ | recognizer = KaldiRecognizer(model, | ||
+ | |||
+ | p = pyaudio.PyAudio() | ||
+ | |||
+ | # Configurar PyAudio para usar PulseAudio (índice 15) | ||
+ | stream = p.open(format=pyaudio.paInt16, | ||
+ | stream.start_stream() | ||
+ | |||
+ | print(" | ||
+ | |||
+ | while True: | ||
+ | data = stream.read(4000, | ||
+ | if recognizer.AcceptWaveform(data): | ||
+ | result = recognizer.Result() | ||
+ | result_json = json.loads(result) | ||
+ | text = result_json.get(" | ||
+ | | ||
+ | # Imprimir el texto detectado | ||
+ | print(f" | ||
+ | |||
+ | # Comparar el texto detectado con el comando esperado | ||
+ | if " | ||
+ | print(" | ||
+ | # Activar la ventana de OBS | ||
+ | subprocess.run([" | ||
+ | # Usa xdotool para simular la pulsación de teclas | ||
+ | subprocess.run([" | ||
+ | |||
+ | # Generar y reproducir el mensaje de audio en los auriculares Bluetooth | ||
+ | tts = gTTS(" | ||
+ | tts.save(" | ||
+ | # Reproducir el archivo de audio con mpv | ||
+ | subprocess.run([" | ||
+ | # subprocess.run([" | ||
+ | os.remove(" | ||
+ | |||
+ | </ |
fotografia/camaras/streaming/obs.1731190345.txt.gz · Last modified: 2024/11/09 22:12 by jose