-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
96 lines (87 loc) · 2.47 KB
/
Copy pathindex.d.ts
File metadata and controls
96 lines (87 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
export type PitchShiftBuffer = Float32Array
export type PitchShiftChannels = Float32Array[]
export type PitchShiftInput = PitchShiftBuffer | PitchShiftChannels
type Writer = (chunk?: PitchShiftInput) => PitchShiftInput
export interface PitchShiftDecision {
method: string
reason: string
ratio: number
semitones: number
content?: 'music' | 'voice' | 'speech' | 'tonal'
formant: boolean
}
export type PitchShiftMethodName =
| 'ola'
| 'vocoder'
| 'phaseLock'
| 'phase-lock'
| 'transient'
| 'psola'
| 'wsola'
| 'granular'
| 'paulstretch'
| 'sms'
| 'hpss'
| 'sample'
| 'hybrid'
| 'formant'
| 'delay'
| 'lpc'
export type PitchShiftMethod =
| PitchShiftMethodName
| {
(data: Float32Array, opts?: PitchShiftOpts): Float32Array
(data: Float32Array[], opts?: PitchShiftOpts): Float32Array[]
(opts?: PitchShiftOpts): Writer
}
export type PitchRatio = number | ((timeSeconds: number) => number) | Float32Array
export interface PitchShiftOpts {
ratio?: PitchRatio
ratioDuration?: number
semitones?: number
formant?: boolean
content?: 'music' | 'voice' | 'speech' | 'tonal'
method?: PitchShiftMethod
onDecision?: (decision: PitchShiftDecision) => void
frameSize?: number
hopSize?: number
sampleRate?: number
transientThreshold?: number
minFreq?: number
maxFreq?: number
envelopeWidth?: number
maxTracks?: number
minMag?: number
tolerance?: number
hpssTimeWidth?: number
hpssFreqWidth?: number
hpssPower?: number
sincRadius?: number
hybridThreshold?: number
window?: number
order?: number
grainSize?: number
seed?: number
}
type PitchShiftFn = {
(data: Float32Array, opts?: PitchShiftOpts): Float32Array
(data: Float32Array[], opts?: PitchShiftOpts): Float32Array[]
(opts?: PitchShiftOpts): Writer
}
export declare const ola: PitchShiftFn
export declare const vocoder: PitchShiftFn
export declare const phaseLock: PitchShiftFn
export declare const transient: PitchShiftFn
export declare const psola: PitchShiftFn
export declare const wsola: PitchShiftFn
export declare const granular: PitchShiftFn
export declare const formant: PitchShiftFn
export declare const paulstretch: PitchShiftFn
export declare const sms: PitchShiftFn
export declare const hpss: PitchShiftFn
export declare const sample: PitchShiftFn
export declare const hybrid: PitchShiftFn
export declare const delay: PitchShiftFn
export declare const lpc: PitchShiftFn
export declare const pitchShift: PitchShiftFn
export default pitchShift