Skip to content

A voice transformation server to manipulate sound files for online experiments

License

Notifications You must be signed in to change notification settings

egaudrain/VTServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VTServer: Voice Transformation Server

The Voice Transformation Server is a Python TCP/IP server that receives commands to process a (local) sound file with a stack of transformations. The modified file is then cached to be served again upon identical request.

The server receives instructions as JSON encoded objects and returns a JSON encoded object that, upon success, points to a file. The VTServer does not serve the file itself. This is up to a web-server, for instance, to do so.

You can run the VTServer directly from the command-line, or it can be deployed as a systemd service (on Linux) using the provided install script (see below).

A basic PHP client is also provided in /php-client. It can be used as a relay to pass a JSON request sent through a web-server.

Full documentation can be found in the /docs folder. Here's an example of processing instruction you can send:

{
    "action": "process",
    "file": "/home/egaudrain/vt_server/test/sound.wav",
    "stack":
        [
            {"module": "world", "f0": "-12st", "vtl": "*1"},
            {
                "module": "vocoder",
                "fs": 44100,
                "analysis_filters": {
                    "f": { "fmin": 100, "fmax": 8000, "n": 16, "scale": "greenwood" },
                    "method": { "family": "butterworth", "order": 6, "zero-phase": true }
                    },
                "synthesis_filters": "analysis_filters",
                "envelope": {
                    "method": "low-pass",
                    "rectify": "half-wave",
                    "order": 2,
                    "fc": 160
                    },
                "synthesis": {
                    "carrier": "noise",
                    "filter_before": false,
                    "filter_after": true
                    }
            }
        ]
}

To get some information about the server, send:

{ "action": "status" }

Installation as a daemon on Ubuntu Linux

The server is written for Python 3.5+.

Install the following dependencies:

$ sudo apt install libsndfile1 python3-full cmake

The installation script will create a virtual environment in the /usr/local/lib/vt_server/venv where the right packages will be installed.

Then, download the repository, e.g.:

$ git clone https://github.com/egaudrain/VTServer.git

In there, there is an install script for Debian-based systems like Ubuntu that rely on systemd. Just run install.ubuntu.sh and it should do everything that's needed. Note that this is a very rudimentary script. It will install everything necessary in /usr/local/lib/vt_server. Once installed, the server runs as user vt_server.

The configuration for the server can be found in /usr/local/etc/vt_server/vt_server.conf.json. Watchout if you modify the cache folder, make sure that the folder exists and that the user vt_server has read/write access to it.

To use 'mp3' as an output format, you need to install LAME:

$ sudo apt install lame

There is a line in the vt_server.conf.json that indicates where the executable is located.

Usage

Check the document in the /docs folder to see how instructions can be sent to the server. Each module has its own set of instructions.

About

A voice transformation server to manipulate sound files for online experiments

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors