SoundEventClassification
SoundEventClassification copied to clipboard
stft_257_1 directory not creating how to fix it please
I am facing the same issue when executing STFT_feature_extractor.ipynb file.
FileNotFoundError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_3812/1066858378.py in <module>
13 for file in os.listdir("Dataset_audio/" + innerDir):
14 if(file.endswith(".wav")):
---> 15 save_STFT("Dataset_audio/" + innerDir + "/" + file, file, activity, subject)
16 print(subject,activity,file)
~\AppData\Local\Temp/ipykernel_3812/579597083.py in save_STFT(file, name, activity, subject)
13 stft = np.abs(librosa.stft(trimmed, n_fft=512, hop_length=256, win_length=512))
14 # save features
---> 15 np.save("STFT_features/stft_257_1/" + subject + "_" + name[:-4] + "_" + activity + ".npy", stft)
16
<__array_function__ internals> in save(*args, **kwargs)
c:\users\anant\appdata\local\programs\python\python39\lib\site-packages\numpy\lib\npyio.py in save(file, arr, allow_pickle, fix_imports)
522 if not file.endswith('.npy'):
523 file = file + '.npy'
--> 524 file_ctx = open(file, "wb")
525
526 with file_ctx as fid:
FileNotFoundError: [Errno 2] No such file or directory: 'STFT_features/stft_257_1/s01_2019-05-22-16-37-48-757000__1_Calling.npy'
Could someone please help?
you have to create /STFT_features/stft_257_1' directory manually and save s01-s17 all audio files