-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. */ | ||
/* ----------------------------------------------------------------- */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |