i want to plot readed audio files

조회 수: 2 (최근 30일)
Deepu S S
Deepu S S 2021년 9월 9일
댓글: Deepu S S 2021년 9월 13일
function CHD_Multiview_Callback(hObject, eventdata, handles)
set(handles.chdprevious, 'Visible','on')
set(handles.chdnext,'visible','on')
set(handles.chdtext,'visible','on')
set(handles.chdpanel,'visible','on')
guidata(hObject, handles);
disp('Entered');
guidata(hObject, handles);
folder_name = uigetdir('','Select src data Directory');
if isequal(folder_name,0)
disp('Directory Selected');
else
% set(handles.EEGFilename,'string','Wait Loading File.......');
disp(['You have selected ', fullfile(folder_name)]);
disp('CHD Audio file processing wait')
handles.srcFolder= fullfile(folder_name);
% set(handles.edDirName,'string',handles.srcFolder);
end
guidata(hObject, handles);
% Specify the folder where the files live.
k='';
myFolder = 'F:\audio';
folder ='F:\';
% AudioArray{k} = audioread(fullfile(folder));
% maxaudio(k) = max(AudioArray{k});
% myFolder = 'F:\audio';
% Check to make sure that folder actually exists. Warn user if it doesn't.
if ~isfolder(myFolder)
errorMessage = sprintf('Error: The following folder does not exist:\n%s\nPlease specify a new folder.', myFolder);
uiwait(warndlg(errorMessage));
myFolder = uigetdir(); % Ask for a new one.
if myFolder == 0
% User clicked Cancel
return;
end
end
% Get a list of all files in the folder with the desired file name pattern.
filePattern = fullfile(myFolder, '**/*.wav'); % Change to whatever pattern you need.
theFiles = dir(filePattern);
for k = 1 : length(theFiles)
baseFileName = theFiles(k).name;
fullFileName = fullfile(theFiles(k).folder, baseFileName);
fprintf(1, 'Now reading %s\n', fullFileName);
% Now do whatever you want with this file name,
% such as reading it in as an image array with imread()
AudioArray = audioread(fullFileName);
[y,fs] = audioread(fullFileName);
subplot = 'theFiles';
help subplot

채택된 답변

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 9월 9일
Maybe you had better employ just one plot() and hold it to plot all imported data from audio files, e.g.:
plot(y), hold all % That will be held and all of the imported audio data will be plotted in a different line color
  댓글 수: 9
Walter Roberson
Walter Roberson 2021년 9월 10일
You did not change
t = (0:size(thisaudio,1)) / thisfs;
to
t = (0:size(thisaudio,1)-1) / thisfs;
like I said to do yesterday.
Deepu S S
Deepu S S 2021년 9월 10일
Now its work thank you

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Deepu S S
Deepu S S 2021년 9월 13일

카테고리

Help CenterFile Exchange에서 Audio Processing Algorithm Design에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by