Archived
17 lines
384 B
Python
17 lines
384 B
Python
import soundfile as sf
|
|
from playsound import playsound
|
|
import numpy as np
|
|
import sys
|
|
from threading import Thread
|
|
|
|
z, fs = sf.read('./calibration_emotion_cut.wav')
|
|
|
|
# options.attenuation_dB = 36;
|
|
z = z * np.power(10.0, (-21.0 / 20))
|
|
|
|
sf.write("calibration_e.wav", z, fs)
|
|
try:
|
|
Thread(target=playsound, args=("calibration_e.wav", )).start()
|
|
except KeyboardInterrupt:
|
|
sys.exit()
|