Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit fb9319e

Browse files
committed
Version 3.2.8
Fix PortAudio dependency handling for voice recording Add graceful fallback when PortAudio is missing Update README with system dependency requirements Add startup diagnostic for missing dependencies
1 parent 675d70b commit fb9319e

File tree

7 files changed

+79
-9
lines changed

7 files changed

+79
-9
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [3.2.8] - 2025-07-27
9+
10+
### Added
11+
12+
- Add graceful fallback when PortAudio is missing
13+
- Add startup diagnostic for missing dependencies
14+
15+
### Fixed
16+
17+
- Fix PortAudio dependency handling for voice recording
18+
19+
### Changed
20+
21+
- Update README with system dependency requirements
822
## [3.2.7] - 2025-07-23
923

1024
### Fixed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![Forks][forks-shield]][forks-url]
77
[![Dynamic TOML Badge][version-shield]][version-url]
88

9-
# ComfyUI ChatterBox SRT Voice (diogod) v3.2.7
9+
# ComfyUI ChatterBox SRT Voice (diogod) v3.2.8
1010

1111
*This is a refactored node, originally created by [ShmuelRonen](https://github.com/ShmuelRonen/ComfyUI_ChatterBox_Voice).*
1212

@@ -221,6 +221,10 @@ This section provides a detailed guide for installing ComfyUI ChatterBox SRT Voi
221221

222222
* ComfyUI installation (Portable, Direct with venv, or through Manager)
223223
* Python 3.12 or higher
224+
* **PortAudio library** (required for voice recording features):
225+
* Linux: `sudo apt-get install portaudio19-dev`
226+
* macOS: `brew install portaudio`
227+
* Windows: Usually bundled with pip packages (no action needed)
224228

225229
### Installation Methods
226230

chatterbox_srt/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""
55

66
# Version info
7-
__version__ = "3.2.7"
7+
__version__ = "3.2.8"
88
__author__ = "Diogod"
99

1010
# Import the new SRT modules

core/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""
55

66
# Version info
7-
__version__ = "3.2.7"
7+
__version__ = "3.2.8"
88
__author__ = "Diogod"
99

1010
# Make imports available at package level

nodes.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Version and constants
2-
VERSION = "3.2.7"
2+
VERSION = "3.2.8"
33
IS_DEV = False # Set to False for release builds
44
VERSION_DISPLAY = f"v{VERSION}" + (" (dev)" if IS_DEV else "")
55
SEPARATOR = "=" * 70
@@ -371,6 +371,21 @@ def error(self, error):
371371
print("⚠️ No local models found - will download from Hugging Face")
372372
print("💡 Tip: First generation will download models (~1GB)")
373373
print(" Models will be saved locally for future use")
374+
375+
# Check for system dependency issues (only show warnings if problems detected)
376+
dependency_warnings = []
377+
378+
# Check PortAudio availability for voice recording
379+
if hasattr(audio_recorder_module, 'SOUNDDEVICE_AVAILABLE') and not audio_recorder_module.SOUNDDEVICE_AVAILABLE:
380+
dependency_warnings.append("⚠️ PortAudio library not found - Voice recording disabled")
381+
dependency_warnings.append(" Install with: sudo apt-get install portaudio19-dev (Linux) or brew install portaudio (macOS)")
382+
383+
# Only show dependency section if there are warnings
384+
if dependency_warnings:
385+
print("📋 System Dependencies:")
386+
for warning in dependency_warnings:
387+
print(f" {warning}")
388+
374389
print(SEPARATOR)
375390

376391
# Print final initialization with nodes list

nodes/audio_recorder_node.py

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,41 @@
11
import torch
22
import torchaudio
33
import numpy as np
4-
import sounddevice as sd
54
import tempfile
65
import os
76
import threading
87
import time
98
import queue
109

10+
# Graceful handling of sounddevice/PortAudio dependency
11+
try:
12+
import sounddevice as sd
13+
SOUNDDEVICE_AVAILABLE = True
14+
except ImportError as e:
15+
SOUNDDEVICE_AVAILABLE = False
16+
SOUNDDEVICE_ERROR = str(e)
17+
print(f"⚠️ ChatterBox Voice Capture: sounddevice not available - {e}")
18+
print("📋 To enable voice recording, install PortAudio:")
19+
print(" Linux: sudo apt-get install portaudio19-dev")
20+
print(" macOS: brew install portaudio")
21+
print(" Windows: Usually bundled with sounddevice")
22+
1123
class ChatterBoxVoiceCapture:
1224
@classmethod
1325
def NAME(cls):
26+
if not SOUNDDEVICE_AVAILABLE:
27+
return "🎙️ ChatterBox Voice Capture (diogod) - PortAudio Required"
1428
return "🎙️ ChatterBox Voice Capture (diogod)"
1529

1630
@classmethod
1731
def INPUT_TYPES(cls):
32+
if not SOUNDDEVICE_AVAILABLE:
33+
return {
34+
"required": {
35+
"error_message": (["PortAudio library not found. Install with: sudo apt-get install portaudio19-dev (Linux) or brew install portaudio (macOS)"], {"default": "PortAudio library not found. Install with: sudo apt-get install portaudio19-dev (Linux) or brew install portaudio (macOS)"}),
36+
}
37+
}
38+
1839
# Get available audio devices
1940
devices = sd.query_devices()
2041
device_names = []
@@ -80,9 +101,25 @@ def INPUT_TYPES(cls):
80101
FUNCTION = "capture_voice_audio"
81102
CATEGORY = "ChatterBox Voice"
82103

83-
def capture_voice_audio(self, voice_device, voice_sample_rate, voice_max_recording_time,
84-
voice_volume_gain, voice_silence_threshold, voice_silence_duration,
85-
voice_auto_normalize, voice_trigger=0):
104+
def capture_voice_audio(self, **kwargs):
105+
if not SOUNDDEVICE_AVAILABLE:
106+
print(f"❌ ChatterBox Voice Capture error: {SOUNDDEVICE_ERROR}")
107+
print("📋 Install PortAudio to enable voice recording:")
108+
print(" Linux: sudo apt-get install portaudio19-dev")
109+
print(" macOS: brew install portaudio")
110+
print(" Windows: Usually bundled with sounddevice")
111+
# Return empty audio tensor
112+
return (torch.zeros(1, 1, 22050),)
113+
114+
# Extract parameters with defaults for graceful fallback
115+
voice_device = kwargs.get('voice_device', '')
116+
voice_sample_rate = kwargs.get('voice_sample_rate', 44100)
117+
voice_max_recording_time = kwargs.get('voice_max_recording_time', 10.0)
118+
voice_volume_gain = kwargs.get('voice_volume_gain', 1.0)
119+
voice_silence_threshold = kwargs.get('voice_silence_threshold', 0.02)
120+
voice_silence_duration = kwargs.get('voice_silence_duration', 2.0)
121+
voice_auto_normalize = kwargs.get('voice_auto_normalize', True)
122+
voice_trigger = kwargs.get('voice_trigger', 0)
86123

87124
print(f"🎤 Starting ChatterBox Voice Capture...")
88125
print(f"Settings: max_time={voice_max_recording_time}s, volume_gain={voice_volume_gain}x, silence_threshold={voice_silence_threshold}, silence_duration={voice_silence_duration}s, rate={voice_sample_rate}")

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "chatterbox_srt_voice"
33
description = "ChatterBox SRT Voice TTS Node is a fork of 'ChatteBox Voice' with additional devolpments and full F5-TTS implementation as well. I introduced a SRT node designed to help you synchronize your generated TTS audio with `.srt` subtitle files. Audio wave analyzer will help you find speech segments for f5 speech edit and much more!"
4-
version = "3.2.7"
4+
version = "3.2.8"
55
license = {file = "LICENSE"}
66
dependencies = ["s3tokenizer>=0.1.7", "resemble-perth", "librosa", "scipy", "omegaconf", "accelerate", "transformers==4.46.3", "# Additional dependencies for SRT support and audio processing", "conformer>=0.3.2", "torch", "torchaudio", "numpy", "einops", "phonemizer", "g2p-en", "unidecode", "# Audio processing and timing dependencies", "soundfile", "resampy", "webrtcvad", "# Optional but recommended for better performance", "numba"]
77

0 commit comments

Comments
 (0)