Update and fix
Server.py :
Modified the class section to add optional argument like path to output the audio for the endpoint tss_to_audio speaker_wav is also optional because I added failover mechanism into the tss_funcs.py to failover to reference.wav from finetuned models. So there's this new import : from typing import Optional And created a TTSStreamRequest class because this endpoint was the only one without class.
Also modified this line to match the default one in main.py : MODEL_FOLDER = os.getenv('MODEL', 'xtts_models')
tts_funcs.py :
added this import at the start : import torchaudio.transforms as T I use it to format the audio output to a more standardly used encoding so it can be used widly without degradation So the def local_generation have been widly modified because of this (maybe I should modify the stream_generation in the same manner)
in def process_tts_to_file :
added a failover mechanism to use the reference.wav from the loaded model if it exist.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Added an option to specify a save path for synthesized audio files.
- Introduced a new streaming request capability for text-to-speech (TTS) services.
- **Enhancements**
- Improved the audio processing and conversion in TTS streaming.
- Streamlined the TTS generation process for better performance.
- **Bug Fixes**
- Fixed an issue with speaker path checks in TTS file generation.
- **Refactor**
- Refactored TTS generation method for clarity and efficiency.
- **Documentation**
- Updated README with revised project inspiration, server purpose, and training dataset information.
- Simplified installation instructions and added Mantella-specific note.
- Expanded Docker usage instructions and acknowledgments in the credit section.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
合并状态:未合并 关闭于 2024-01-27 2 条评论