sox speed pertrub shape (T, C), float64, process using int32

pull/622/head
Hui Zhang 4 years ago
parent c7708d8aed
commit 9f907b9bad

@ -351,7 +351,9 @@ class AudioSegment(object):
tfm.set_globals(multithread=False) tfm.set_globals(multithread=False)
tfm.speed(speed_rate) tfm.speed(speed_rate)
self._samples = tfm.build_array( self._samples = tfm.build_array(
input_array=self._samples, sample_rate_in=self._sample_rate).copy() input_array=self._samples,
sample_rate_in=self._sample_rate).squeeze(-1).astype(
np.float32).copy()
def normalize(self, target_db=-20, max_gain_db=300.0): def normalize(self, target_db=-20, max_gain_db=300.0):
"""Normalize audio to be of the desired RMS value in decibels. """Normalize audio to be of the desired RMS value in decibels.

@ -1,4 +1,13 @@
[ [
{
"type": "speed",
"params": {
"min_speed_rate": 0.9,
"max_speed_rate": 1.1,
"num_rates": 3
},
"prob": 0.0
},
{ {
"type": "shift", "type": "shift",
"params": { "params": {

@ -6,7 +6,7 @@
"max_speed_rate": 1.1, "max_speed_rate": 1.1,
"num_rates": 3 "num_rates": 3
}, },
"prob": 0.0 "prob": 1.0
}, },
{ {
"type": "shift", "type": "shift",

Loading…
Cancel
Save