audio file add in machine learning activity if occurs

1 visualización (últimos 30 días)
Farhad Hossain
Farhad Hossain el 1 de Nov. de 2019
above URL;
% I am Trying to play sound *** if activity == 'Walking' ***, but it's not working.
% Also I tried using if strcmp(activity,'Walking'); both result fail
% Please help........below code
*****************************************************************************
%add below function in "Human_Activity_Learning.m"
[y, Fs] = audioread('Walking Playing.wav'); % 1 second audio file
walking_sound = audioplayer(y, Fs); % Global variable: walking_sound
**********************************************
% In "plotActivityResults.m" function, I added play function
try
for ii = 1:height(humanActivityTest)
mycell1 = fieldnames(mdl);
myclassifier1 = strcat('mdl.',mycell1(3));
activity = predict(eval(myclassifier1{:}),humanActivityTest{ii,1:end-1});
if activity == 'Walking'
predclr = [1 0 0];
play(walking_sound);
else
predclr = [0 0.7 0.3];
end

Respuestas (0)

Categorías

Más información sobre Audio Processing Algorithm Design en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by