Nodes/ComfyUI-Gemini_Flash_2.0_Exp/🎤 Audio Recorder Gemini
ComfyUI Node

🎤 Audio Recorder Gemini

The 'click record, speak, done' mic node that feeds Gemini voice analysis

By ShmuelRonen·Created 2 years ago·Updated about a year ago· 337
🎤 Audio Recorder Gemini
    • AUDIO
    â—„deviceDefaultâ–º
    â—„sample_rate44100â–º
    â—„silence_threshold0.010â–º
    â—„silence_duration2.0â–º
    â—„trigger0â–º

    This is the voice-input half of the pack: a microphone recorder that hands its audio straight to the Gemini Flash nodes. Click the "Start Recording" button on the canvas, talk, and it stops itself when you go quiet - no setting clip lengths, no trimming by hand. The recorded clip comes out as a standard AUDIO tensor that you wire into the Gemini node's audio input with input_type: "audio" and a prompt like "Transcribe and analyze this." It's the closest this pack gets to a voice-chat loop, and honestly the cleanest way to test Gemini's audio understanding without hunting down an audio file.

    How it works

    The node uses sounddevice to open a live mic stream in 100ms chunks. After each chunk it checks the peak amplitude; when the signal stays below silence_threshold for silence_duration seconds straight, it stops, trims the trailing silence, saves the clip as a WAV in ComfyUI's temp directory, and returns {"waveform", "sample_rate"} to the graph.

    One behavior that will confuse you the first time: the node caches your last recording. Clicking record increments a hidden trigger counter, and the node only records fresh audio when that counter changes. If you just re-run the workflow without clicking the button again, you get the cached clip back - the button click is the record signal, not the workflow run. That's intentional (so you can re-analyze without re-recording), but it means "I re-ran the queue and it recorded nothing new" is expected behavior, not a bug.

    Inputs that matter

    • device - your microphone. The dropdown is populated at runtime from sounddevice.query_devices() (whatever mics your system reports), which is why comfy.icu shows it as an empty list - the choices don't exist until the node runs on your machine.
    • silence_threshold (0.001–0.1, default 0.01) - amplitude below which the node thinks you're quiet. In a loud room you'll need to raise it or recording never stops.
    • silence_duration (0.5–5s, default 2s) - how long the quiet has to last before it cuts. 2 seconds is a good talking pace; drop it if you pause a lot mid-sentence.
    • sample_rate (default 44100, up to 96kHz) - quality knob; the Gemini node resamples to 16kHz anyway.
    • trigger - hidden in the UI; the canvas button bumps it for you.

    Output is a single AUDIO tensor. Wire it into the Gemini node's audio input.

    Installing it

    Install the pack via ComfyUI Manager or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ShmuelRonen/ComfyUI-Gemini_Flash_2.0_Exp.git
    

    The recorder needs sounddevice (it's in the pack's requirements.txt, so Manager installs it), plus torchaudio. On Ubuntu/Debian you also need PortAudio at the OS level or you'll get no input devices at all:

    sudo apt-get install libportaudio2
    

    Common issues

    • Empty device dropdown or "no input devices" - PortAudio isn't installed. Run the apt-get install libportaudio2 above and restart ComfyUI.
    • Recording never stops - your room is louder than silence_threshold. Raise it.
    • It stops while you're still talking - you pause too long; raise silence_duration.

    The recorder is a thin utility and it does one job well: turn your voice into a wire that Gemini can hear. Just remember you still need the API key on the Gemini node - the mic works fine without one; the analysis won't.

    Categoryaudio

    Inputs (5)

    NameTypeDefaultDescription
    deviceCOMBODefault0 options:
    sample_rateINT441008000–96000—
    silence_thresholdFLOAT0.0100.001–0.1—
    silence_durationFLOAT2.00.5–5—
    triggerINT0—

    Outputs (1)

    NameTypeDescription
    AUDIOAUDIO—