Archived
Initial commit
This commit is contained in:
commit
d89b82be4a
103 files changed
+23110
No files matched your search
@@ -0,0 +1,28 @@
|
||||
from expe_build_conditions import expe_build_conditions
|
||||
from expe_options import expe_options
|
||||
import os
|
||||
import soundfile as sf
|
||||
import numpy as np
|
||||
from naoqi import ALProxy
|
||||
from tqdm import tqdm
|
||||
import random
|
||||
|
||||
|
||||
# aap = ALProxy("ALAudioPlayer", "", 9559)
|
||||
|
||||
|
||||
options = expe_options()
|
||||
expe_build_conditions(options)
|
||||
|
||||
files = os.listdir(options["tmp_path"] + "2")
|
||||
y = np.array([])
|
||||
for i in tqdm(range(len(files))):
|
||||
r = random.randint(0, len(files)-1)
|
||||
x, fs = sf.read(os.path.join(options["tmp_path"] + "2", str(files[r])))
|
||||
x = x * np.power(10, -(options["attenuation_dB"]/20.0))
|
||||
y = np.append(y, x)
|
||||
|
||||
sf.write("calibration.wav", np.concatenate(
|
||||
(np.zeros((1024*3, 2)), np.tile(y, (2, 1)).T, np.zeros((1024*3, 2)))), fs)
|
||||
|
||||
# aap.ALAudioPlayer.play()
|
||||
Reference in new issue
Block a user