Fix Echo-TTS character voice file-path fallback and compressed audio loading
Technical details:
- Preserve Character Voices and dropdown audio_path fallback in Echo-TTS voice mapping
- Allow Echo-TTS narrator and character fallback to use file paths when decoded tensors are unavailable
- Expand safe audio loading fallback order to support OGG and other compressed formats when torchaudio fails
Correcting test assertions for create_silence (returns 1D for mono)
Correcting test assertions for normalize_audio_tensor (keeps 1D as 1D)
Fixed production bug in pad_audio_to_duration - silence tensor dimensions didn't match input audio
Move int16 to float [-1, 1] normalization from Character Voices node into
the safe_load_audio() utility function so ALL engines benefit from the fix.
Changes:
- safe_load_audio() now normalizes int16 values to [-1, 1] range automatically
- Handles PyTorch 2.9 torchaudio.load() behavior change and scipy fallback
- Remove duplicate normalization from Character Voices node
- F5-TTS now uses safe_load_audio() instead of torchaudio.load() directly
This fixes TorchCodec DLL errors on ALL engines that load audio files with PyTorch 2.9,
not just Character Voices. F5-TTS, ChatterBox, and future engines all benefit.
Removed torchcodec from requirements.txt and install.py to eliminate the FFmpeg
system dependency that was causing Windows installation failures.
Implementation:
- Removed torchcodec>=0.2.0 from requirements.txt
- Removed torchcodec>=0.2.0 from install.py core_packages list
- Removed torchaudio 2.9+ migration warnings (no longer applicable)
- Added AudioProcessingUtils.safe_load_audio() utility for robust audio loading
- Updated all audio loading calls to use fallback-aware utility function
Audio Loading Changes:
- character_voices_node.py: Uses safe_load_audio() with fallback support
- tts_text_node.py: Uses safe_load_audio() for narrator and character voices (2x)
- tts_srt_node.py: Uses safe_load_audio() for narrator voice
- higgs_audio_tts_processor.py: Uses safe_load_audio() (2x)
- higgs_audio_srt_processor.py: Uses safe_load_audio() (2x)
- index_tts_processor.py: Uses safe_load_audio() (2x)
- f5tts_streaming_adapter.py: Uses safe_load_audio()
- higgs_audio_adapter.py: Uses safe_load_audio()
- subprocess.py: Uses safe_load_audio()
Compatibility:
- torchaudio.load() works fine with fallback backends (soundfile, scipy)
- No quality loss - only negligible audio loading speed difference (~milliseconds)
- All existing audio formats supported
- Better error handling with graceful fallbacks
- _extract_audio_tensor now returns both original and mono versions
- Analysis (silence detection, energy, peaks) performed on MONO version only
- Visualization and graphs generated from MONO version
- Output audio (processed and segmented) uses ORIGINAL stereo format
- Timing regions found from mono are applied directly to stereo samples
- Stereo audio now passes through analyzer without quality loss
- Segmented audio preserves stereo channel information
Fix VideoHelper audio compatibility with universal normalizer
Technical implementation:
- Add _get_audio() method to BaseChatterBoxNode for universal audio format handling
- Update Voice Changer, Merge Audio, and ChatterBox VC nodes to use normalizer
- Centralize audio input processing in AudioProcessingUtils.normalize_audio_input()
- Support VideoHelper LazyAudioMap, Character Voices, and standard AUDIO formats
- Maintain backward compatibility with existing workflows
Fixes issue #32: VideoHelper Suite audio inputs now work with all audio-processing nodes