vpeakserver

command module
v0.0.0-...-626d928 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2025 License: MIT Imports: 11 Imported by: 0

README

vpeakserver

vpeakserver logo

A lightweight server for vpeak, providing TTS capabilities via RESTful API.

Prerequisites

  • Local VOICEPEAK Installation: Ensure that VOICEPEAK are installed locally on your machine. Refer to their official documentation for installation steps.

Installation & Usage

go install github.com/shinshin86/vpeakserver@latest

After installation, run the server:

vpeakserver

Note:

  • By default, the server starts on port 20202.
  • By default, CORS policy mode is set to localapps, which automatically allows requests from localhost and app:// origins.
  • You can specify additional allowed CORS origins using the -allowed-origin flag. For example:
    # Allow access from example.com
    vpeakserver -allowed-origin="https://example.com"
    
  • You can also set the CORS policy mode using the -cors-policy-mode flag:
    # Set CORS policy mode to 'all'
    vpeakserver -cors-policy-mode="all"
    

Endpoint

This repository provides a simple HTTP server for handling audio synthesis requests. It exposes two main endpoints:

  1. /audio_query: Accepts a POST request with query parameters to return a JSON-encoded AudioQuery.
  2. /synthesis: Accepts a POST request with a JSON body that generates and returns an audio file (.wav) synthesized using the specified text and speaker.
  3. /setting: Provides a web interface for configuring CORS settings.

Features

  • Audio Query Endpoint:
    Sends a POST request to /audio_query with text and speaker as required query parameters. Optional emotion, speed, and pitch parameters let you mirror the synthesis request and validate them before submission.

  • Audio Synthesis Endpoint:
    Sends a POST request to /synthesis with a JSON payload including text, speaker, and optional emotion, speed, pitch. If successful, the server responds with a .wav audio file generated by vpeak.

  • Voice Parameter Control:

    • emotion: Supports happy, fun, angry, sad. Any other value will be ignored.
    • speed: Integer in the range 50200.
    • pitch: Integer in the range -300300.
  • CORS Support:
    Configurable via the -allowed-origin flag, allowing cross-origin requests from a specified domain (default: http://localhost:3000) or from any origin by setting -allowed-origin=*.

  • Settings Web Interface:
    Access http://localhost:20202/setting to configure CORS policies through a user-friendly web interface. The settings page allows you to:

    • Choose between different CORS policy modes:
      • localapps: Restricts CORS to app:// and localhost origins, plus any additional origins specified
      • all: Allows all origins (equivalent to setting -allowed-origin="*")
    • Add specific allowed origins (space-separated for multiple origins)
    • Changes to these settings take effect immediately but require a server restart for complete application.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL