@audio/shift-psola 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +18 -0
- package/package.json +41 -0
package/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { psola as stretch } from 'time-stretch'
|
|
2
|
+
import { makeStretchShift } from '@audio/shift-core'
|
|
3
|
+
|
|
4
|
+
// Pitch-Synchronous Overlap-Add pitch shift (Moulines-Charpentier 1990). PSOLA
|
|
5
|
+
// time-stretch at `factor = ratio` — autocorrelation period contour → pitch marks →
|
|
6
|
+
// two-period Hann grains placed at pitch-synchronous intervals — followed by
|
|
7
|
+
// anti-aliased sinc resample back to original length. The final resample rescales the
|
|
8
|
+
// whole spectrum by `ratio`, so formants move with f0 same as `wsola`; the win here is
|
|
9
|
+
// fewer grain-boundary artifacts on voiced monophonic material, not formant preservation.
|
|
10
|
+
// Falls back to plain WSOLA internally when the input has no reliable pitch period
|
|
11
|
+
// (unvoiced/polyphonic/noisy) — designed for monophonic voiced material.
|
|
12
|
+
let deriveOpts = (opts) => ({
|
|
13
|
+
sampleRate: opts?.sampleRate || 44100,
|
|
14
|
+
minFreq: opts?.minFreq,
|
|
15
|
+
maxFreq: opts?.maxFreq,
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
export default makeStretchShift(stretch, deriveOpts)
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@audio/shift-psola",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "PSOLA (Pitch-Synchronous Overlap-Add) pitch shift — pitch-synchronous grains for monophonic voice",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"main": "index.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./index.js",
|
|
10
|
+
"./package.json": "./package.json"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"index.js"
|
|
14
|
+
],
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@audio/shift-core": "^1.0.0",
|
|
17
|
+
"time-stretch": "^1.2.1"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"author": "audiojs",
|
|
24
|
+
"homepage": "https://github.com/audiojs/shift/tree/main/packages/shift-psola#readme",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/audiojs/shift.git",
|
|
28
|
+
"directory": "packages/shift-psola"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"audio",
|
|
32
|
+
"pitch-shift",
|
|
33
|
+
"psola",
|
|
34
|
+
"voice",
|
|
35
|
+
"speech",
|
|
36
|
+
"dsp"
|
|
37
|
+
],
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=18"
|
|
40
|
+
}
|
|
41
|
+
}
|