function x = tnp_voicecalc(nbSec) %VOICECALC Evaluate an expression from a sound stream % Inputs: % s sound stream to evaluate % Ouputs: % x result of expression computation % Get human voice %freq = 16e3; %uiwait(msgbox(strcat('Vous avez ', int2str(nbSec),' secondes pour parler'))); %snd = wavrecord(nbSec * freq, freq, 'double'); % Cut voice into words %words = tnp_cut(snd(100:length(snd))); % show the number of word recognized and play each it %fprintf(1, int2str(length(words))); %for i=1:length(words) % wavplay(words{i}, freq); %end database = 'E:\tnp\database\lureau_m-16384Hz\'; db = tnp_loaddatabase(database, false, 3); %tnp_test_base(db, database); x = tnp_recognize2(db, strcat(database, 'trois\trois3.wav')); %words = tnp_splitsound(s) %for i = 1 : length(words) % words(i) = tnp_normalize(words(i)); % calc(i) = tnp_recognize(db, words(i)); %end %x = tnp_evaluate(calc)