Skip to main content

Pieces together voice files to form sentences

Project description

HLVox

pipeline status coverage report PyPI version

Originally intended to create sentences from the word snippets for the Half Life 1 Vox, this project can take a folder of word audio files and piece them into sentences. This repo when used standalone (ie by running voice.py directly) will output the sentences as audio files.

Getting Started

To use this project, you will first need a folder full of voice files. If you have Half Life 1 installed, the voices can be extracted from the VPK files using something like GCFScape.

Prerequisites

Python dependencies are managed with uv in this workspace.

An installation of FFMpeg is required. On Ubuntu, just run the following:

apt update
apt install ffmpeg

For persistence, a local sqlite database can be used, or a postgresql database. These are not exposed through the basic CLI.

Installing

How to set up a basic dev environment:

Pull this repo

git pull https://gitlab.com/bhagen/hlvox.git

Change into the new repo directory

cd hlvox

Sync Python dependencies with uv

uv sync

Run commands via uv run from this repo root

uv run --project hlvox python --version

Quick Start

If you want to jump right into generating a sentence, you can point voice.py at a folder of voice audio files!

python hlvox/voice.py --voice-dir ~/my_folder_of_voice_files "the sentence I want to generate"

Your sentence will be exported in the same directory that you ran the file from.

Installing package locally for development

From the repo root:

uv run --project hlvox pip install --editable hlvox

Running the tests

Run tests from the repo root:

uv run --with pytest --with pytest-cov --with coverage --project hlvox --directory hlvox pytest --cov=hlvox ./tests

Documentation Generation

I used Sphinx to create autodoc documentation from docstrings in the modules.

Change into doc directory

cd doc

(If you've modified the source code, grab the new apidocs

sphinx-apidoc -f -o ./source ../hlvox

Generate documentation

make html

Authors

  • Blair Hagen - Initial work - bhagen

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • Thanks to Valve for making such an amazing voice

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hlvox-0.18.3.tar.gz (25.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hlvox-0.18.3-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file hlvox-0.18.3.tar.gz.

File metadata

  • Download URL: hlvox-0.18.3.tar.gz
  • Upload date:
  • Size: 25.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for hlvox-0.18.3.tar.gz
Algorithm Hash digest
SHA256 9a20d07abe54b9d36c9895503625f2bd8e030f1a9511361681f3cd7efcb117c7
MD5 1565ee0440232850d1b175919adad716
BLAKE2b-256 a96d5b91cde5e9852d0370040147f1a51a88d8763db2a51a80918e52e1bdf10d

See more details on using hashes here.

File details

Details for the file hlvox-0.18.3-py3-none-any.whl.

File metadata

  • Download URL: hlvox-0.18.3-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for hlvox-0.18.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6f5416f6be59c30bae26312c2c1d57a166f3ab5ffb5ca47e5ac6d34c412bfd0a
MD5 f2e31c16b299aa56f7cfd7ddbe14074f
BLAKE2b-256 f1deda2f11424995bc4bcd6a811704ab9b7db036b5229ee3a1da1f1fcb5d1812

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page