Files
voice_recognition/whisper/lib/whisper_web/live/vad_live.ex

29 lines
795 B
Elixir

defmodule WhisperWeb.VadLive do
use WhisperWeb, :live_view
def mount(_, _, socket) do
{:ok, assign(socket, started: false)}
end
def render(assigns) do
~H"""
<div id="vad-container" phx-hook="VadHook">
<button phx-click="start_vad" class="btn btn-primary">🎙 Iniciar VAD</button>
<button phx-click="stop_vad" class="btn btn-danger">🛑 Detener VAD</button>
<div id="vad-status" class="mt-4 text-sm text-gray-700"></div>
</div>
"""
end
def handle_event("start_vad", _, socket) do
push_event(socket, "init-vad", %{})
{:noreply, socket}
end
def handle_event("stop_vad", _, socket) do
push_event(socket, "stop-vad", %{})
{:noreply, socket}
end
end