feat(voice/clone): support MP3 and other audio formats for reference voices (#20)
## Summary - Adds support for MP3, FLAC, OGG, and other audio formats when uploading reference voices for cloning - Replace WAV-only `audio_read()` with a `soundfile`-based implementation - Update web UI file picker to accept multiple audio formats ## Changes - `pocket_tts/data/audio.py`: Use `soundfile` library instead of Python's `wave` module - `pocket_tts/main.py`: Preserve original file extension in temp files for format detection - `pocket_tts/main.py`: Add missing `truncate=True` to CLI generate command - `pocket_tts/static/index.html`: Update file input to accept `.wav,.mp3,.flac,.ogg,.m4a,audio/*` - `pyproject.toml`: Add `soundfile>=0.12.0` dependency ## Tested - [x] Upload a WAV file as reference voice and generate speech - [x] Upload an MP3 file as reference voice and generate speech - [x] Upload a FLAC file as reference voice and generate speech - [x] Verify CLI `--voice` option works with MP3 files --------- Co-authored-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com> Co-authored-by: Václav Volhejn <8401624+vvolhejn@users.noreply.github.com>
This commit is contained in:
co-authored by
Gabriel de Marmiesse
Václav Volhejn
parent
6f9dd250c2
commit
bedd1c4098
@@ -23,6 +23,9 @@ dependencies = [
|
||||
"requests>=2.20.0",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
audio = ["soundfile>=0.12.0"]
|
||||
|
||||
|
||||
[dependency-groups]
|
||||
dev = [
|
||||
|
||||
Reference in New Issue
Block a user