Skip to content

Commit 089ef0f

Browse files
authored
Merge pull request #14 from seyong92/numpy_pad_support
Numpy pad support
2 parents 9ac8bdf + bc98590 commit 089ef0f

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@ python:
33
- "3.6"
44
- "3.7"
55
- "3.8"
6+
env:
7+
- NUMPY_VERSION=1.16.6
8+
- NUMPY_VERSION=1.17.5
9+
- NUMPY_VERSION=1.18.5
10+
- NUMPY_VERSION=1.19.2
611
before_install:
712
- pip install poetry
813
install:
914
- poetry install
15+
- pip install -q numpy==$NUMPY_VERSION
1016
script:
1117
- pytest

pytsmod/tdpsolatsm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def tdpsola(x, sr, src_f0, tgt_f0=None, alpha=1, beta=None,
8181
output_length = int(np.ceil(x_chan.size * alpha))
8282

8383
pad = int(np.ceil(sr / 100))
84-
x_chan = np.pad(x_chan, (pad, pad))
84+
x_chan = np.pad(x_chan, (pad, pad), 'constant')
8585
y_chan = np.zeros(output_length + 2 * pad) # output signal
8686

8787
tk = pitch_period[0] + 1 # output pitch mark

pytsmod/wsolatsm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def wsola(x, s, win_type='hann',
5959
# padding the input audio sequence.
6060
left_pad = int(win_size // 2 + tolerance)
6161
right_pad = int(np.ceil(1 / min_fac) * win_size + tolerance)
62-
x_padded = np.pad(x, ((0, 0), (left_pad, right_pad)))
62+
x_padded = np.pad(x, ((0, 0), (left_pad, right_pad)), 'constant')
6363

6464
aw_pos = aw_pos + tolerance
6565

0 commit comments

Comments
 (0)