@@ -121,8 +121,8 @@ def apply_effects_tensor(
121
121
122
122
"""
123
123
tensor_np = tensor .numpy ()
124
- ret = paddleaudio ._paddleaudio .sox_effects_apply_effects_tensor (tensor_np , sample_rate ,
125
- effects , channels_first )
124
+ ret = paddleaudio ._paddleaudio .sox_effects_apply_effects_tensor (
125
+ tensor_np , sample_rate , effects , channels_first )
126
126
if ret is not None :
127
127
return (paddle .to_tensor (ret [0 ]), ret [1 ])
128
128
raise RuntimeError ("Failed to apply sox effect" )
@@ -139,7 +139,7 @@ def apply_effects_file(
139
139
140
140
Note:
141
141
This function works in the way very similar to ``sox`` command, however there are slight
142
- differences. For example, ``sox`` commnad adds certain effects automatically (such as
142
+ differences. For example, ``sox`` command adds certain effects automatically (such as
143
143
``rate`` effect after ``speed``, ``pitch`` etc), but this function only applies the given
144
144
effects. Therefore, to actually apply ``speed`` effect, you also need to give ``rate``
145
145
effect with desired sampling rate, because internally, ``speed`` effects only alter sampling
@@ -228,14 +228,14 @@ def apply_effects_file(
228
228
>>> pass
229
229
"""
230
230
if hasattr (path , "read" ):
231
- ret = paddleaudio ._paddleaudio .apply_effects_fileobj (path , effects , normalize ,
232
- channels_first , format )
231
+ ret = paddleaudio ._paddleaudio .apply_effects_fileobj (
232
+ path , effects , normalize , channels_first , format )
233
233
if ret is None :
234
234
raise RuntimeError ("Failed to load audio from {}" .format (path ))
235
235
return (paddle .to_tensor (ret [0 ]), ret [1 ])
236
236
path = os .fspath (path )
237
- ret = paddleaudio ._paddleaudio .sox_effects_apply_effects_file (path , effects , normalize ,
238
- channels_first , format )
237
+ ret = paddleaudio ._paddleaudio .sox_effects_apply_effects_file (
238
+ path , effects , normalize , channels_first , format )
239
239
if ret is not None :
240
240
return (paddle .to_tensor (ret [0 ]), ret [1 ])
241
241
raise RuntimeError ("Failed to load audio from {}" .format (path ))
0 commit comments