Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-Authored-By: Takenori Yoshimura <[email protected]>
  • Loading branch information
kan-bayashi and takenori-y authored Aug 15, 2019
1 parent 328f154 commit 5038e62
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions espnet/nets/pytorch_backend/wavenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,14 @@ def generate(self, x, h, n_samples, interval=None, mode="sampling"):
This generation based on `Fast WaveNet Generation Algorithm`_.
Args:
x (LongTensor): Initial wavenform tensor with the shape (T).
x (LongTensor): Initial waveform tensor with the shape (T,).
h (Tensor): Auxiliary feature tensor with the shape (n_samples + T, n_aux).
n_samples (int): Number of samples to be generated.
interval (int, optional): Log interval.
mode (str, optional): "sampling" or "argmax".
Return:
ndarray: Generated quantized wavenform (n_samples).
ndarray: Generated quantized waveform (n_samples).
.. _`Fast WaveNet Generation Algorithm`: https://arxiv.org/abs/1611.09482
Expand Down
4 changes: 2 additions & 2 deletions utils/convert_fbank.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Note: <log-dir> defaults to <data-dir>/log, and <fbank-dir> defaults to <data-di
Options:
--nj <nj> # number of parallel jobs
--fs <fs> # sampling rate
--fmax <fmax> # Maximum frequency
--fmin <fmin> # Minimum frequency
--fmax <fmax> # maximum frequency
--fmin <fmin> # minimum frequency
--n_fft <n_fft> # number of FFT points (default=1024)
--n_shift <n_shift> # shift size in point (default=256)
--win_length <win_length> # window length in point (default=)
Expand Down
4 changes: 2 additions & 2 deletions utils/generate_wav.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ scp=${data}/feats.scp

split_scps=""
for n in $(seq ${nj}); do
split_scps="$split_scps $logdir/feats.$n.scp"
split_scps="$split_scps $logdir/feats.${n}.scp"
done

utils/split_scp.pl ${scp} ${split_scps} || exit 1;
Expand All @@ -74,4 +74,4 @@ ${cmd} JOB=1:${nj} ${logdir}/generate_with_wavenet_${name}.JOB.log \

rm ${logdir}/feats.*.scp 2>/dev/null

echo "Succeeded creating wav for $name"
echo "Succeeded creating wav for ${name}"
4 changes: 2 additions & 2 deletions utils/generate_wav_from_fbank.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __call__(self, y):
y (ndarray): Wavnform signal normalized from -1 to 1 (N,).
Returns:
y (ndarray): Noise shaped wavnform signal normalized from -1 to 1 (N,).
y (ndarray): Noise shaped waveform signal normalized from -1 to 1 (N,).
"""
# check shape and type
Expand Down Expand Up @@ -177,7 +177,7 @@ def main():
h = scaler.transform(lmspc) # normalize features

# convert to tensor
x = torch.tensor(x, dtype=torch.long, device=device) # (1, )
x = torch.tensor(x, dtype=torch.long, device=device) # (1,)
h = torch.tensor(h, dtype=torch.float, device=device) # (T, n_aux)

# get length of waveform
Expand Down
2 changes: 1 addition & 1 deletion utils/synth_wav.sh
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then
model_corpus=$(echo ${models} | cut -d. -f 1)
vocoder_model_corpus=$(echo ${vocoder_models} | cut -d. -f 1)
if [ ${model_corpus} != ${vocoder_model_corpus} ]; then
echo "${vocoder_models} does not support ${models} (Due to the sampling rare mismatch)."
echo "${vocoder_models} does not support ${models} (Due to the sampling rate mismatch)."
exit 1
fi
download_vocoder_models
Expand Down

0 comments on commit 5038e62

Please sign in to comment.