Files
spark-pocket-tts/pyproject.toml
T
bedd1c4098 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>
2026-01-20 10:12:50 +01:00

74 lines
1.5 KiB
TOML

[project]
name = "pocket-tts"
requires-python = ">= 3.10,<3.15"
description = "Kyutai's pocket-sized TTS!"
version = "1.0.1"
readme = "README.md"
dependencies = [
"numpy>=2",
# I tried 2.4.0 but the generated audio is wrong, so 2.5+ is needed.
"torch>=2.5.0",
"pydantic>=2",
"sentencepiece>=0.2.1",
"beartype>=0.22.5",
"safetensors>=0.4.0",
"typer>=0.10.0",
"typing_extensions>=4.0.0",
"fastapi>=0.100",
"uvicorn>=0.13.0",
"python-multipart>=0.0.21",
"scipy>=1.5.0",
"einops>=0.4.0",
"huggingface_hub>=0.10",
"requests>=2.20.0",
]
[project.optional-dependencies]
audio = ["soundfile>=0.12.0"]
[dependency-groups]
dev = [
"coverage>=7.6.12",
"line-profiler>=5.0.0",
"pytest>=9.0.2",
"pytest-xdist>=3.8.0",
]
[tool.uv.sources]
torch = [
{ index = "pytorch-cpu" },
]
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[tool.ruff]
line-length = 100
[tool.ruff.format]
line-ending = "lf"
# avoid having a trailing comma changing
# the behavior of the formatter
skip-magic-trailing-comma = true
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["pocket_tts"]
[project.scripts]
pocket-tts = "pocket_tts.main:cli_app"
[tool.uv]
# System python distribution can have header files missing, so we use only the python
# distributions provided by uv which have everything included.
python-preference = "only-managed"
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"