My currrent issue is trying to take a folder with 40 .wav files, (10s clips for each instrument that add up to 40s total)
but all are labeled, "01_composer_basson", "01_composer_violin"……"02_composer_basson"….and so on
I cannot seem to write a for loop properly to get all the 10s clips for each .wav into each of their own directories.
I can then break them up and anaylize them by cattinizing them.
How can i fix my loop so i can get each instrument .wav file to the directory?
i have this so far, i apologize in advanced for my lack of matlab skills!
%extracts the audio files from the main folder and puts them into folders
%based on their name.....
function [] = AudioExtract()File = ls('\\users\audio_stems\');%folders for seperate instruments
mkdir Bassonmkdir Saxphonemkdir Clarinetmkdir Violin% the original folder all the files are in has 40 .wav files
%10 for each instrumnet
for i=1:42 % first reaults are a . then a ..(
if(File(i,3) ~= '_') continue else if mod(i,3)==0 disp('.'); end if (strfind(File(1,:), 'basson') ~= 0) Intsrument = 'Basson'; else (strfind(File(1,:), 'clarinet') ~=0); Intrsrument = 'Carinet'; if (strfind(File(1,:), 'saxaphone') ~= 0) Instrument='Saxaphone';
Best Answer