Archived
18 lines
652 B
Python
18 lines
652 B
Python
import soundfile as sf
|
|
|
|
def generate(stimulus, attenuation):
|
|
x, fs = sf.read("/home/nao/PICKA/Python_scripts/stimuli/emotion/" + stimulus)
|
|
x = x * 10.0 ** float(attenuation)/20
|
|
sf.write('/home/nao/PICKA/Python_scripts/stimuli/emotion/gen_stimulus.wav', x,fs)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
import argparse
|
|
parser = argparse.ArgumentParser(description="Generates stimulus for emotion PICKA test")
|
|
parser.add_argument('-s', '--stimulus', help="Stimulus to be generated")
|
|
parser.add_argument('-a', '--attenuation', help="Attenuation to be applied")
|
|
args = parser.parse_args()
|
|
generate(args.stimulus, args.attenuation)
|
|
|
|
|