facebookresearch / WavAugment

A library for speech data augmentation in time-domain
MIT License
640 stars 57 forks source link

Speed Effect Augmentation? #12

Closed BilalDendani closed 4 years ago

BilalDendani commented 4 years ago

Hello every one, I am asking about applying speed as a speech augmentation technique. Does the source code provide an implementation for this technique. I tried with the command Sped = augment.EffectChain.speed(100), however an invalid syntax issue. Please, I need an example about speed augmentation if it is implemented in the library. Thank you.

haoheliu commented 4 years ago

Hi,

I tried the speed effect too and it works well. I guess there is some kind of limit for the parameter. Maybe the one you use is too large for the speed function. You can try:

augment.EffectChain.speed(1.5) augment.EffectChain.speed(2)

Thank you.

haoheliu commented 4 years ago

Hello every one, I am asking about applying speed as a speech augmentation technique. Does the source code provide an implementation for this technique. I tried with the command Sped = augment.EffectChain.speed(100), however an invalid syntax issue. Please, I need an example about speed augmentation if it is implemented in the library. Thank you.

Also, I find 'tempo' have a better speeding effect than 'speed'

BilalDendani commented 4 years ago

Thank you for your answer @haoheliu. However, the error still remains when launching the commands augment.EffectChain.speed(1.5) augment.EffectChain.speed(2) The error is AttributeError: 'float' object has no attribute '_append_effect_to_chain' when executing augment.EffectChain.speed(1.5)

haoheliu commented 4 years ago

Thank you for your answer @haoheliu. However, the error still remains when launching the commands augment.EffectChain.speed(1.5) augment.EffectChain.speed(2) The error is AttributeError: 'float' object has no attribute '_append_effect_to_chain' when executing augment.EffectChain.speed(1.5)

Sorry I cannot reproduce this errors. The following code works fine for me. You can try them in colab:

y = augment.EffectChain().speed(1.5).rate(16000)
y = y.apply(x, src_info={'rate': sr})
ipd.Audio(y, rate=sr)

y = augment.EffectChain().speed(1.5) # have no effect, but also have no error
y = y.apply(x, src_info={'rate': sr})
ipd.Audio(y, rate=sr)

y = augment.EffectChain().tempo(1.5)
y = y.apply(x, src_info={'rate': sr})
ipd.Audio(y, rate=sr)
haoheliu commented 4 years ago

Thank you for your answer @haoheliu. However, the error still remains when launching the commands augment.EffectChain.speed(1.5) augment.EffectChain.speed(2) The error is AttributeError: 'float' object has no attribute '_append_effect_to_chain' when executing augment.EffectChain.speed(1.5)

Hey, I got it. You miss the brackets after the "EffectChain".

eugene-kharitonov commented 4 years ago

@haoheliu thanks for the help! @BilalDendani - does this solve your issue?

BilalDendani commented 4 years ago

Thanks @eugene-kharitonov and @haoheliu. I missed the two brackets after EffectChain method like suggested by @haoheliu. Issue solved. Thank you so much.