Skip to content

Commit

Permalink
add readme and license
Browse files Browse the repository at this point in the history
  • Loading branch information
mes51 committed Nov 14, 2021
1 parent f115b19 commit 2a3d1ca
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 0 deletions.
51 changes: 51 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Copyright (c) 2021 mes51

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

/* ----------------------------------------------------------------- */
/* WORLD: High-quality speech analysis, */
/* manipulation and synthesis system */
/* developed by M. Morise */
/* http://www.kisc.meiji.ac.jp/~mmorise/world/english/ */
/* ----------------------------------------------------------------- */
/* */
/* Copyright (c) 2010 M. Morise */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or */
/* without modification, are permitted provided that the following */
/* conditions are met: */
/* */
/* - Redistributions of source code must retain the above copyright */
/* notice, this list of conditions and the following disclaimer. */
/* - Redistributions in binary form must reproduce the above */
/* copyright notice, this list of conditions and the following */
/* disclaimer in the documentation and/or other materials provided */
/* with the distribution. */
/* - Neither the name of the M. Morise nor the names of its */
/* contributors may be used to endorse or promote products derived */
/* from this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS */
/* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, */
/* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */
/* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, */
/* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY */
/* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
/* POSSIBILITY OF SUCH DAMAGE. */
/* ----------------------------------------------------------------- */
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# WORLD#

WORLD# is a pure C# porting of [WORLD](https://github.com/mmorise/World)

## Usage

```csharp
var framePeriod = 5.0;
var sampleRate = 44100;
var audio = new double[441000]; // monaural audio data
// f0 estimate
var harvest = new Harvest();
harvest.UseMultiThread = true; // optional
var f0Length = harvest.GetSamplesForHarvest(sampleRate, audio.Length, framePeriod);
var f0 = new double[f0Length];
var timeAxis = new double[f0Length];
harvest.Estimate(audio, sampleRate, timeAxis, f0);

// spectral envelope estimate
var cheapTrick = new CheapTrick(sampleRate);
var fftSize = cheapTrick.GetFFTSizeForCheapTrick(sampleRate);;
cheapTrick.FFTSize = fftSize;
cheapTrick.UseMultiThread = true; // optional
var spectrogram = Enumerable.Range(0, f0Length).Select(_ => new double[fftSize / 2 + 1]).ToArray();
cheapTrick.Estimate(audio, sampleRate, timeAxis, f0, spectrogram);

// aperiodicity estimate
var d4c = new D4C(sampleRate);
d4c.UseMultiThread = true; // optional
var aperiodicity = Enumerable.Range(0, f0Length).Select((i) => new double[fftSize / 2 + 1]).ToArray();
d4c.Estimate(audio, timeAxis, f0, f0Length, fftSize, aperiodicity);

// synthesize
var yLength = (int)((f0.Length - 1) * framePeriod / 1000.0 * sampleRate) + 1;
var synthesis = new Synthesis(sampleRate);
var result = new double[yLength];
synthesis.Synthesize(f0, f0.Length, spectrogram, aperiodicity, fftSize, framePeriod, result);
```

## Caveats

* DIO, Stonemask and tools are not ported

0 comments on commit 2a3d1ca

Please sign in to comment.