world

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2015 License: BSD-3-Clause Imports: 1 Imported by: 1

README

GO-WORLD

Build Status GoDoc

GO-WORLD is a Go port to WORLD - a high-quality speech analysis, modification and synthesis system. WORLD provides a way to decompose a speech signal into:

  • Fundamental frequency (F0)
  • spectral envelope
  • aperiodicity

and re-synthesize a speech signal from these paramters. See here for the original WORLD.

Supported Platforms

  • Linux
  • Mac OS X

Note that the original WORLD works in windows as well. In order to use WORLD in windows, you have to build WORLD yourself since currently we don't have a installation script.

Installation

Binary dependency

First you need to install WORLD as a shared library:

git clone https://github.com/r9y9/WORLD.git && cd world
git checkout v0.2.1-3
./waf configure && ./waf
sudo ./waf install
GO-WORLD
go get github.com/r9y9/go-world

complete!

Usage

Import the package

import "github.com/r9y9/go-world"

and create a world instance with sample rate [hz] and frame period [ms].

w := world.New(sampleRate, framePeriod) // e.g. (44100, 5)

and then you can do whatever you want with WORLD.

F0 estimation and refinement
Dio
timeAxis, f0 := w.Dio(input, w.NewDioOption()) // default option is used

StoneMask
refinedF0 := w.StoneMask(input, timeAxis, f0)

Spectral envelope estimation by CheapTrick
spectrogram := w.CheapTrick(input, timeAxis, f0)

Aperiodicity ratio estimation by D4C
apiriodicity := w.D4C(input, timeAxis, f0)

Synthesis
w.Synthesis(f0, spectrogram, apiriodicity, len(input))

Example

see example/world_example.go

License

Modified-BSD

Documentation

Overview

Package world provide a Go interface to WORLD - a high-quality speech analysis, modification and synthesis system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheapTrick

func CheapTrick(x []float64, fs int, timeAxis, f0 []float64) [][]float64

func D4C added in v0.1.0

func D4C(x []float64, fs int, timeAxis, f0 []float64) [][]float64

func Dio

func Dio(x []float64, fs int, option DioOption) ([]float64, []float64)

func GetFFTSizeForCheapTrick

func GetFFTSizeForCheapTrick(fs int) int

func GetFFTSizeForStar

func GetFFTSizeForStar(fs int) int

GetFFTSizeForStar is deprecated. Use GetFFTSizeForCheapTrick instead.

func GetSamplesForDIO

func GetSamplesForDIO(fs, x_length int, framePeriod float64) int

func StoneMask

func StoneMask(x []float64, fs int, timeAxis, f0 []float64) []float64

func Synthesis

func Synthesis(f0 []float64, spectrogram, aperiodicity [][]float64,
	framePeriod float64, fs, length int) []float64

Types

type DioOption

type DioOption struct {
	F0Floor          float64
	F0Ceil           float64
	ChannelsInOctave float64
	FramePeriod      float64 // [ms]
	Speed            int     // (1,2, ..., 12)
	AllowedRange     float64 // recommended: 0.02 * FramePeriod
}

func NewDioOption

func NewDioOption() DioOption

type World

type World struct {
	Fs          int
	FramePeriod float64 // [ms]
}

World represents WORLD - high-quality speech analysis, modification and synthesis system.

func New

func New(fs int, framePeriod float64) *World

New returns a new world instanece with sample rate (fs) and framePeriod [ms].

func (*World) CheapTrick

func (w *World) CheapTrick(x []float64, timeAxis, f0 []float64) [][]float64

func (*World) D4C added in v0.1.0

func (w *World) D4C(x, timeAxis, f0 []float64) [][]float64

func (*World) Dio

func (w *World) Dio(x []float64, option DioOption) ([]float64, []float64)

func (*World) NewDioOption

func (w *World) NewDioOption() DioOption

NewDioOption returns a default DioOpton.

func (*World) Star

func (w *World) Star(x []float64, timeAxis, f0 []float64) [][]float64

Star is deprecated. Use CheapTrick instead.

func (*World) StoneMask

func (w *World) StoneMask(x []float64, timeAxis, f0 []float64) []float64

func (*World) Synthesis

func (w *World) Synthesis(f0 []float64,
	spectrogram, aperiodicity [][]float64, length int) []float64

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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