How do I extract the audiodata from a struct that I got from dir

Technical Source
2 min readOct 23, 2023

--

I have a folder with 100 wav files I need to iterate through and apply different functions to

This is what I have so far

clear
% Tester_object = audioread("Recordings\Speaker Female\Eendbekdier\f_ebd_1.wav");
% plot(Tester_object);
dir("Recordings\Male Lump\");
audio_files = dir(fullfile("Recordings\Male Lump\", '*.wav'));
for i=1:height(audio_files)
name = audio_files(i).name;
Tester = audioread(name); % This is the line that is not working that I don't know how to fix
%-------- Functions applied in this square to 'Tester'
% FFT
% Frequency spectrum bands
% Comparator
%-------- These are all sorted

end

I just need to know how do I get the audiodata from within the struct that is created by dir(fullfile…..

NOTE:-

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help , Finance Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

This won’t work when you are working with more dynamics folders but this is the solution that I found

clear
% Tester_object = audioread("Recordings\Speaker Female\Eendbekdier\f_ebd_1.wav");
% plot(Tester_object);
dir("Recordings\Male Lump\");
audio_files = dir(fullfile("Recordings\Male Lump\", '*.wav'))
anemone = audio_files(5).name
x = strcat("Recordings\Male Lump\" + anemone)
Check= audioread(x)

SEE COMPLETE ANSWER CLICK THE LINK

--

--

Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.