function [ inp, tgt ] = wavload( traindir, num_anfis_input_params)
% load wavs from a dir and convert to parameters
%   Detailed explanation goes here

files = dir([traindir '\*.wav']);  

inp=[]; %vstupni signaly v radcich
tgt=[]; %nastavi jazyky (podle predpony 'c,h,e') - target
for i=1:length(files)   %nacita kazdy soubor
    [inp_tmp,Fs]=wavread([traindir '\' files(i).name]);

    inp_tmp = inp_tmp ./ max(max(abs(inp_tmp)));
    %inp = [inp; inp_tmp(round(linspace(1, length(inp_tmp), num_anfis_input_params)),1)'];  %vybira 100 prvek z prvniho sloupce / vlozi do radku
    inp = [inp; fftparams( inp_tmp, 14, Fs ) ];

    lang=files(i).name(1); 
    if (lang == 'c')
        tgt = [tgt; 1 0 0];
    elseif (lang == 'h')
            tgt = [tgt; 0 1 0];
    elseif (lang == 'e')
            tgt = [tgt; 0 0 1];
    else 
            tgt = [tgt; 0 0 0];
    end
end
end

